[SERVER-8688] Explain output should include index spec Created: 23/Feb/13  Updated: 10/Dec/14  Resolved: 13/Apr/14

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

Type: Bug Priority: Major - P3
Reporter: Scott Hernandez (Inactive) Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: explain, neweng, query_triage
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-4325 BasicCursor may be reported by explai... Closed
Related
related to SERVER-10026 New query system Closed
Operating System: ALL
Participants:

 Description   

Since some people name their indexes we need to include the index spec with the explain output.



 Comments   
Comment by J Rassi [ 13/Apr/14 ]

Fixed by new explain field "stats" field introduced in SERVER-10026. The full explain stats includes "keyPattern" information for each index scan stage.

> db.foo.find({a:1,b:1}).explain(true).stats
{
	"type" : "KEEP_MUTATIONS",
	"works" : 1,
	"yields" : 0,
	"unyields" : 0,
	"invalidates" : 0,
	"advanced" : 0,
	"needTime" : 0,
	"needFetch" : 0,
	"isEOF" : 1,
	"children" : [
		{
			"type" : "FETCH",
			"works" : 1,
			"yields" : 0,
			"unyields" : 0,
			"invalidates" : 0,
			"advanced" : 0,
			"needTime" : 0,
			"needFetch" : 0,
			"isEOF" : 1,
			"alreadyHasObj" : 0,
			"forcedFetches" : 0,
			"matchTested" : 0,
			"children" : [
				{
					"type" : "IXSCAN",
					"works" : 1,
					"yields" : 0,
					"unyields" : 0,
					"invalidates" : 0,
					"advanced" : 0,
					"needTime" : 0,
					"needFetch" : 0,
					"isEOF" : 1,
					"keyPattern" : "{ a: 1.0 }",
					"boundsVerbose" : "field #0['a']: [1.0, 1.0]",
					"isMultiKey" : 0,
					"yieldMovedCursor" : 0,
					"dupsTested" : 0,
					"dupsDropped" : 0,
					"seenInvalidated" : 0,
					"matchTested" : 0,
					"keysExamined" : 0,
					"children" : [ ]
				}
			]
		}
	]
}
>

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