[DOCS-4557] Find & list all "stage" values from the new query plan in the docs Created: 18/Dec/14  Updated: 11/Jan/17  Resolved: 18/Dec/14

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: 01112017-cleanup

Type: Improvement Priority: Major - P3
Reporter: William Cross Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 9 years, 8 weeks, 6 days ago

 Description   

Currently, there is at least one undocumented query plan stage, "KEEP_MUTATIONS". I have no idea what it's doing. We should probably put a reference for all possible values here.

Output:

shard02:PRIMARY> db.foo.find( { a : 1, b : 1 } ).explain()
{
	"queryPlanner" : {
		"plannerVersion" : 1,
		"parsedQuery" : {
			"$and" : [
				{
					"a" : {
						"$eq" : 1
					}
				},
				{
					"b" : {
						"$eq" : 1
					}
				}
			]
		},
		"winningPlan" : {
			"stage" : "KEEP_MUTATIONS",
			"inputStage" : {
				"stage" : "FETCH",
				"filter" : {
					"a" : {
						"$eq" : 1
					}
				},
				"inputStage" : {
					"stage" : "IXSCAN",
 
 
					"keyPattern" : {
						"b" : 1
					},
					"isMultiKey" : false,
					"direction" : "forward",
					"indexBounds" : {
						"b" : [
							"[1.0, 1.0]"
						]
					}
				}
			}
		},
		"rejectedPlans" : [
			{
				"stage" : "FETCH",
				"inputStage" : {
					"stage" : "IXSCAN",
					"keyPattern" : {
						"a" : 1,
						"b" : 1
					},
					"isMultiKey" : false,
					"direction" : "forward",
					"indexBounds" : {
						"a" : [
							"[1.0, 1.0]"
						],
						"b" : [
							"[1.0, 1.0]"
						]
					}
				}
			}
		]
	},
	"serverInfo" : {
		"host" : "cross-mb-air.local",
		"port" : 27021,
		"version" : "2.8.0-rc2",
		"gitVersion" : "f77869e01a6ed235695a46fad441c0dff15202f6"
	},
	"ok" : 1
}

This is on 2.8.0-rc2, in the shell. I've got a sharded cluster (3 shards) each with 3 replica sets. I've launched them all with mlaunch v.1.1.7, with, at the bash prompt:

mlaunch init --replicaset --sharded 3



 Comments   
Comment by William Cross [ 18/Dec/14 ]

Also a SHARDING_MERGE stage.

Comment by William Cross [ 18/Dec/14 ]

found stage "SINGLE SHARD" that is used for unsharded collections when you do your query on the mongos.

Comment by William Cross [ 18/Dec/14 ]

I think KEEP_MUTATION is what happens when there are keys included in the query that aren't covered by the index, and it has to scan through them without using the index, after that index has done all it can.

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