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

Allow multikey index scans to be exploded for sorts

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Querying
    • Query Optimization

    Description

      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.

      Attachments

        Activity

          People

            backlog-query-optimization Backlog - Query Optimization
            ian.boros@mongodb.com Ian Boros
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated: