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

Create a property-based test to assert query planner does not generate plans that are never optimal

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Optimization
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Some query plans we can identify as never being optimal, no matter the scenario (indexes, documents, etc). One example is a full ixscan + fetch with no filter for a query with no sort. As long as the index is not sparse, a collection scan is always preferable. We saw this behavior in SERVER-102227.

      We can write a property-based test to search for patterns in plans that are never optimal. Then if we make a change to the enumerator, the test will fail if we see these types of plans.

      Some ideas from ben.shteinfeld@mongodb.com:

      • An index scan should not be followed by a SORT stage if the index scan can satisfy that sort.
      • Filters on projected out fields should be removed

            Assignee:
            Unassigned Unassigned
            Reporter:
            matt.boros@mongodb.com Matt Boros
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              None
              None
              None
              None