Explode for sort doesn't work if the index have multi-key path at the end

XMLWordPrintableJSON

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

      When analyzing what sort can we provide by exploding an index scan, we return false (so no sorts) if we encounter a multi-key path in the suffix: https://github.com/mongodb/mongo/blob/995d977db8a8542e5ddb2d442882e42f439349c4/src/mongo/db/query/planner_analysis.cpp#L1089

      This return false should be replaced with just break, because if there are regular paths before a multi-key path, we still can provide some kind of sort

              Assignee:
              Ben Shteinfeld
              Reporter:
              Ivan Fefer
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: