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

push limit down into index scan for sort + limit queries

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

      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.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            aaron Aaron Staple
            Votes:
            5 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated: