summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/sbe_stage_builder_index_scan.cpp
diff options
context:
space:
mode:
authorNikita Lapkov <nikita.lapkov@mongodb.com>2021-05-18 11:52:26 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-05-19 09:00:41 +0000
commit39c04abc9ec9da43130f64f2158b9b6293bf1d80 (patch)
tree5033de15672e62e69bd8af29503dedb52afb3126 /src/mongo/db/query/sbe_stage_builder_index_scan.cpp
parentb91fb0dabf5fd1f5193df8e450b46081fbb23b13 (diff)
downloadmongo-39c04abc9ec9da43130f64f2158b9b6293bf1d80.tar.gz
SERVER-57014 Include all index keys in relevant slots for index filter
Diffstat (limited to 'src/mongo/db/query/sbe_stage_builder_index_scan.cpp')
-rw-r--r--src/mongo/db/query/sbe_stage_builder_index_scan.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/db/query/sbe_stage_builder_index_scan.cpp b/src/mongo/db/query/sbe_stage_builder_index_scan.cpp
index 28b3d9cfdd4..b1af7fb38e5 100644
--- a/src/mongo/db/query/sbe_stage_builder_index_scan.cpp
+++ b/src/mongo/db/query/sbe_stage_builder_index_scan.cpp
@@ -1046,8 +1046,9 @@ std::pair<std::unique_ptr<sbe::PlanStage>, PlanStageSlots> generateIndexScan(
auto indexFilterKeySlots = makeIndexKeyOutputSlotsMatchingParentReqs(
ixn->index.keyPattern, indexFilterKeyBitset, indexKeyBitset, indexKeySlots);
- relevantSlots.insert(
- relevantSlots.end(), indexFilterKeySlots.begin(), indexFilterKeySlots.end());
+ // Relevant slots must include slots for all index keys in case they are needed by parent
+ // stages (for instance, covered shard filter).
+ relevantSlots.insert(relevantSlots.end(), indexKeySlots.begin(), indexKeySlots.end());
auto outputStage = generateIndexFilter(state,
ixn->filter.get(),