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

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Optimization
    • None
    • 3
    • 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
            Reporter:
            Matt Boros
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: