[SERVER-3758] push limit down into index scan for sort + limit queries Created: 04/Sep/11  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Aaron Staple Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 5
Labels: query_triage
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File server3758.js    
Issue Links:
Duplicate
is duplicated by SERVER-3122 Range queries on compound indexes inv... Closed
Related
is related to SERVER-10026 New query system Closed
is related to SERVER-3310 Query optimizer should efficiently ha... Closed
Assigned Teams:
Query Optimization
Participants:

 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.


Generated at Thu Feb 08 03:03:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.