If you have an index on ( a , b ) and do a query like find( { a :
{ $in : [ ... }} ).sort(
{ b : 1 } ).limit(10)
an easy optimization is limiting the results for each $in element to the limit.
- is depended on by
-
SERVER-3310 Query optimizer should efficiently handle $in and sort with compound index.
- Closed
- related to
-
SERVER-5481 query on undefined field matches empty array
- Closed
-
SERVER-5777 Add support for a range constraint on the first sort field to in/sort/limit optimization
- Closed
-
SERVER-5450 refactor and optimize FieldRangeVectorIterator
- Closed
-
SERVER-6268 report both winning plan nscanned and total nscanned in explain output
- Closed