-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Querying
-
Query Optimization
index {a:1,b:1}
find( {a:{$gte:2,$lte:4}} ).sort( {b:1} ).limit(5)
There is a missing optimization for the query above. The query engine could scan only the first 5 values of b for each value of a.
See SERVER-3122 for initial description and SERVER-3310 for a related case.
- is duplicated by
-
SERVER-3122 Range queries on compound indexes involve unnecessary scanning when sorting and limit are involved
- Closed
- is related to
-
SERVER-10026 New query system
- Closed
-
SERVER-3310 Query optimizer should efficiently handle $in and sort with compound index.
- Closed