-
Type: Bug
-
Resolution: Duplicate
-
Priority: Minor - P4
-
None
-
Affects Version/s: 3.4.2
-
Component/s: Index Maintenance, Querying
-
None
-
ALL
-
If you create a multikey index on an array of sub document fields and then perform a range query using that index it will only use one bound of the index. One bound will be one of the values from that range query whilst the other will be either Inf.0 or -Inf.0.
The query is constructed using $elemMatch.
This is a problem because if a user queries for a range that matches index keys close to the middle of the index, then the database will scan half the documents before getting to the correct documents to return.
- duplicates
-
SERVER-15086 Allow for efficient range queries over non-array fields in multikey indices
- Closed