diff options
author | Nikita Lapkov <nikita.lapkov@mongodb.com> | 2021-05-18 11:52:26 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-05-19 09:00:41 +0000 |
commit | 39c04abc9ec9da43130f64f2158b9b6293bf1d80 (patch) | |
tree | 5033de15672e62e69bd8af29503dedb52afb3126 /src/mongo/db | |
parent | b91fb0dabf5fd1f5193df8e450b46081fbb23b13 (diff) | |
download | mongo-39c04abc9ec9da43130f64f2158b9b6293bf1d80.tar.gz |
SERVER-57014 Include all index keys in relevant slots for index filter
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/query/sbe_stage_builder_index_scan.cpp | 5 |
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(), |