-
Type: Improvement
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.6.1
-
Component/s: Querying
-
None
Prior to 2.6, the query planner would consider plans for $or beneath an $and according to a logical rewrite to disjunctive normal form. For example, suppose we have indices {a: 1, b: 1} and {a: 1, c: 1}. For the query
db.coll.find({a: 3, $or: [{b: 4}, {c: 5}]});
the query planner would instead plan this as
db.coll.find({$or: [{a: 3, b: 4}, {a: 3, c: 5}]});
The first clause uses the index {a: 1, b: 1} and the second uses {a: 1, c: 1}.
In 2.6, the query planner does not consider this rewrite and therefore can miss some of the plans considered by 2.4.
- duplicates
-
SERVER-13732 Predicates in top-level implicit AND query not considered when generating index access plan for contained OR
- Closed
- is duplicated by
-
SERVER-14740 Query rewrite of special $or leaf case to rooted $or not working for nested expressions
- Closed