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

Allow multikey index scans to be exploded for sorts

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

      Currently the planner prevents exploding an index to provide a sort when the sort is on a multikey field. See here.

      Conceptually there's no reason we must enforce this restriction. Under certain conditions described in SERVER-31898 we can actually use an index to provide a sort on a multikey field.

      One way to implement this optimization is to change explodeForScan to return a success/fail indicator. After this function builds the index scan node which has point bounds on the first components we can use the existing logic in IndexScanNode to determine whether the sort is actually provided. See here.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            ian.boros@mongodb.com Ian Boros
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: