-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Index Maintenance
-
None
-
ALL
The "Equality, Range Query, And Sort" section of Jesse's blog post here describes how if you do a range query on one field and sort on another you have to choose between lowering your nscanned or getting rid of the in-memory sort. If you put the sort key first, you get rid of the in-memory sort, but at the cost of higher nscanned. If you put the sort key last, however, you can get nscanned down to exactly n, but you'll have to do an in-memory sort.
- duplicates
-
SERVER-3071 Index Intersection
- Closed
- is related to
-
SERVER-3310 Query optimizer should efficiently handle $in and sort with compound index.
- Closed