Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-13236

Consider not enumerating index intersection solutions unless the AND is top-level

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 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.

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: