[SERVER-56483] SBE explain output for ixscan/ixseek stage should indicate which index is being read Created: 29/Apr/21  Updated: 29/Oct/23  Resolved: 07/Oct/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.2.0, 5.1.0-rc3

Type: Improvement Priority: Major - P3
Reporter: David Storch Assignee: Bobby Morck (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Documented
is documented by DOCS-14926 Investigate changes in SERVER-56483: ... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v5.1
Sprint: QE 2021-10-04, QE 2021-10-18
Participants:

 Description   

When an SBE plan involves in ixscan or ixseek stage, the explain output associated with that stage looks something like this:

				"stage" : "ixseek",
				"planNodeId" : 1,
				"nReturned" : 3,
				"executionTimeMillisEstimate" : 0,
				"advances" : 3,
				"opens" : 1,
				"closes" : 1,
				"saveState" : 0,
				"restoreState" : 0,
				"isEOF" : 1,
				"numReads" : 3,
				"seeks" : 1,
				"recordSlot" : 5,
				"recordIdSlot" : 6,
				"snapshotIdSlot" : 3,
				"seekKeySlotLow" : 7,
				"seekKeySlotHigh" : 8,
				"outputSlots" : [ ],
				"indexKeysToInclude" : "00000000000000000000000000000000"

Notably absent from this output is any indication of what the index is. We should include the index name and/or key pattern. For comparison, here is what the output from the classic engine's IXSCAN stage looks like:

			"stage" : "IXSCAN",
			"nReturned" : 3,
			"executionTimeMillisEstimate" : 0,
			"works" : 4,
			"advanced" : 3,
			"needTime" : 0,
			"needYield" : 0,
			"saveState" : 0,
			"restoreState" : 0,
			"isEOF" : 1,
			"keyPattern" : {
				"a" : 1
			},
			"indexName" : "a_1",
			"isMultiKey" : false,
			"multiKeyPaths" : {
				"a" : [ ]
			},
			"isUnique" : false,
			"isSparse" : false,
			"isPartial" : false,
			"indexVersion" : 2,
			"direction" : "forward",
			"indexBounds" : {
				"a" : [
					"(0.0, inf.0]"
				]
			},
			"keysExamined" : 3,
			"seeks" : 1,
			"dupsTested" : 0,
			"dupsDropped" : 0

We should consider adding the following information to SBE explain output for ixscan/ixseek as part of this ticket:

  • Index name
  • Index key pattern
  • Index version
  • Whether the index is multikey
  • The index's multikey paths
  • Whether the index is unique
  • Whether the index is sparse
  • Whether the index is partial


 Comments   
Comment by Githook User [ 01/Nov/21 ]

Author:

{'name': 'Bobby Morck', 'email': 'bobby.morck@mongodb.com', 'username': 'bmorck'}

Message: SERVER-56483 Adding indexName to execution stats explain output for ix_scan and ix_seek stages
Branch: v5.1
https://github.com/mongodb/mongo/commit/1def5203788935317651916f06a0aac2cadc8dce

Comment by Githook User [ 07/Oct/21 ]

Author:

{'name': 'Bobby Morck', 'email': 'bobby.morck@mongodb.com', 'username': 'bmorck'}

Message: SERVER-56483 Adding indexName to execution stats explain output for ix_scan and ix_seek stages
Branch: master
https://github.com/mongodb/mongo/commit/1dacc4642dd2400abc6c95d8239fca5671a34f72

Comment by Anton Korshunov [ 04/May/21 ]

This information is available in the explain output under the queryPlanner section, so I personally don't see a huge value duplicating this info in the executionStats section. An ixscan/ixseek can always be mapped to a corresponding IXSCAN QSN from where one can pull the index name.

Comment by Alex Bevilacqua [ 04/May/21 ]

ana.meza including this information per ixscan/ixseek will facilitate visual and tool-based parsing of these plans so I would say yes, it's important

Comment by Ana Meza [ 04/May/21 ]

Adding christopher.harris alex.bevilacqua, could you please advise if this is important?

Thanks

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