The _targetQuery function always passes in a valid QueryTargetingInfo object. This means we are always passing a valid set to getShardIdsForRange and whenever we target all shard ids, we will insert every chunk into an ordered set.
The _targetQuery function should instead pass a nullptr if chunkRanges is also nullptr to skip this work in cases where its result won't even be used.
- is caused by
-
SERVER-75312 analyzeShardKey command misclassifies queries with $expr equality on the shard key
-
- Closed
-
- related to
-
SERVER-95448 Remove call to getAllChunkRanges as part of getShardIdsForRange
-
- Closed
-