[SERVER-7742] Improve the way indexes are used to do a range query on one field and sort on another Created: 21/Nov/12  Updated: 23/Sep/13  Resolved: 23/Sep/13

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Unassigned
Resolution: Duplicate Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-3071 Index Intersection Closed
Related
is related to SERVER-3310 Query optimizer should efficiently ha... Closed
Operating System: ALL
Participants:

 Description   

The "Equality, Range Query, And Sort" section of Jesse's blog post here describes how if you do a range query on one field and sort on another you have to choose between lowering your nscanned or getting rid of the in-memory sort. If you put the sort key first, you get rid of the in-memory sort, but at the cost of higher nscanned. If you put the sort key last, however, you can get nscanned down to exactly n, but you'll have to do an in-memory sort.


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