-
Type: Improvement
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.6.0-rc1
-
Component/s: Querying
-
None
Suppose we have indices on 'a', 'b', and we receive the following query:
db.coll.find({$or: [{a: 1, b: 1}, {a: 2, b: 2}]});
We could end up enumerating 9 possible solutions, as there are three possibilities for each branch (use 'a', use 'b', and use index intersection). If all combinations are considered than 3 * 3 = 9. This is the search space explosion problem for $or that is currently being tracked in SERVER-13184.
Regardless of the approach taken for SERVER-13184, we can mitigate the problem by not enumerating index intersection solutions if the AND is not top-level. For the example above, this would reduce the number of possibilities to 2 * 2 = 4.
- related to
-
SERVER-13184 2.6 should explore same number of one index solns as 2.4
- Closed