-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.2.2
-
Component/s: Querying
-
None
-
ALL
Lets say you are querying for { a:{ $gt:10, $lt:20 } }
and you have an index on a, b
If b is multikey, the query optimizer will scan a much wider range of index and it will have to scan the objects to complete query evaluation. This is because the optimizer doesn't know if all the values of a are scalar; if they are not a document like { _id:2, { a:[ 5, 25 ] } } would match the query.
This makes the advice that an index on a is not needed if you have an index on a, b incorrect and makes performance optimization confusing.
- duplicates
-
SERVER-15086 Allow for efficient range queries over non-array fields in multikey indices
- Closed
- is duplicated by
-
SERVER-8454 Multi-key index prevents bounds being used for non-multi-key part
- Closed
- is related to
-
SERVER-3173 Planner should use path-level multikey info to generate covered plans when possible
- Closed
-
SERVER-6050 Consider allowing $elemMatch applied to non arrays
- Closed
- related to
-
SERVER-12470 document and audit multikey bounds behavior
- Closed