|
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.
|