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

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

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Won't Fix
    • 2.6.0-rc1
    • None
    • Querying
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: