[SERVER-5019] covered indexes are not implemented for scan and order sorts Created: 20/Feb/12  Updated: 10/Dec/14  Resolved: 04/Nov/14

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

Type: Improvement Priority: Major - P3
Reporter: Aaron Staple Assignee: David Storch
Resolution: Duplicate Votes: 1
Labels: coveredIndex, query_triage
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-15221 Planner sort analysis should not add ... Closed
Related
is related to SERVER-4161 nscannedObjects is not calculated pro... Closed
is related to SERVER-5759 indexOnly in explain() is not reporte... Closed
Participants:

 Description   

Covered indexes work with straight cursor reads, but not in memory sorts. However, explain output incorrectly states that the queries are 'indexOnly'.

 
> c.find( {}, {_id:0,b:1} ).hint( {a:1,b:1} ).sort( {b:1} ).explain()
{
	"cursor" : "BtreeCursor a_1_b_1",
	"nscanned" : 0,
	"nscannedObjects" : 0,
	"n" : 0,
	"scanAndOrder" : true,
	"millis" : 1,
	"nYields" : 0,
	"nChunkSkips" : 0,
	"isMultiKey" : false,
	"indexOnly" : true,
	"indexBounds" : {
		"a" : [
			[
				{
					"$minElement" : 1
				},
				{
					"$maxElement" : 1
				}
			]
		],
		"b" : [
			[
				{
					"$minElement" : 1
				},
				{
					"$maxElement" : 1
				}
			]
		]
	},
	"server" : "Aaron-Staples-MacBook-Pro.local:27017"
}



 Comments   
Comment by David Storch [ 04/Nov/14 ]

This ticket is duplicated by SERVER-15221. Closing in favor of the newer ticket, as it uses new query planner terminology and refers to the new code.

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