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

Support sort keys in clustered collection scans in SBE

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

      SERVER-77280 allowed for the OR stage to have clustered collection scans as its children, and will unblock the bug described in SERVER-61259. However, the query below for a clustered collection fails: 

      coll.find({ $or: [{ _id: { $lt: 1 } }, { _id: { $gt: 8 } }] }).sort({_id:1});

      The generated plan is MERGE_SORT with 2 CLUSTERED_IXSCAN children. In SBE this tassert is hit, but this generated plan works in classic. Therefore, SBE should support these plans and support sort keys when building clustered collection scans.

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            gil.alon@mongodb.com Gil Alon
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: