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

push limit down into index scan for sort + limit queries

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: Querying
    • Labels:

      Description

      index {a:1,b:1}
      find( {a:{$gte:2,$lte:4}} ).sort( {b:1} ).limit(5)

      There is a missing optimization for the query above. The query engine could scan only the first 5 values of b for each value of a.

      See SERVER-3122 for initial description and SERVER-3310 for a related case.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-server-query Backlog - Query Team
              Reporter:
              aaron Aaron Staple
              Participants:
              Votes:
              6 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated: