-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Follow-up from SERVER-125555.
db.c.createIndex({"arr.a": 1, "arr.b": 1});
db.c.find({arr: {$elemMatch: {a: {$ne: 1}, $or: [{b: {$lt: 2}}, {b: {$gt: 3}}]}}}).explain();
On 7.0, we are able to do an $or pushdown, which is fine since the relevant part of the predicate is entirely beneath the $elemMatch:
"indexBounds" : { "arr.a" : [ "[MinKey, 1.0)", "(1.0, MaxKey]" ], "arr.b" : [ "(3.0, inf.0]" ] }
However, after 8.0, we get [MinKey, MaxKey] bounds on "arr.b".
- is related to
-
SERVER-125555 $elemMatch + $not should be able to use index scan
-
- Closed
-
- related to
-
SERVER-78260 Contained $or rewrite optimization incorrectly lifts a negation predicate outside an $elemMatch leading to missing query results
-
- Closed
-