explain multiKeyPaths interpretation
Parent: MongoDB Compound Index Design: ESR, Selectivity, Covering and Multikey Bounds · Published reference · snapshot 2026-10-21 · skill ranked-29798f23
↓ Facts as markdownall context files
Source-anchored research for explain multiKeyPaths interpretation. Run status: COMPLETED.
These notes link each claim to its source. Some citations identify archived research reports that are no longer hosted on this site. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.
Structure and components
- An empty per-key list does not prove that the source document path contains no array. A positional key such as e.0 can read e[0] from an array without generating multiple index keys, so its multiKeyPaths entry can be empty while e is an array. (high confidence) (verified as of 2026-07-21) [source]
- multiKeyPaths is per indexed key, while isMultiKey describes the index as a whole. Thus isMultiKey: true can coexist with one key having an empty list while another key has a non-empty list; an empty list means no multikey path component is recorded for that key, not that the whole index is non-multikey. (high confidence) [source]
How it works
- For an IXSCAN, multiKeyPaths maps each key in keyPattern to the indexed path prefix or prefixes that cause multikey expansion. For example, stock.quantity: ['stock'] identifies an array ancestor, while a compound index can have isMultiKey: true and Owner: [] because the array expansion applies to another indexed key. (high confidence) [source]
Problems, failure modes and limitations
- MongoDB issue SERVER-130777 reports a narrow resumable index-build failure where a concurrent array write can be lost from multikey state, leaving explain to report isMultiKey: false and causing a matching array document to be missed. The issue lists MongoDB 6.0.0, 7.0.0, and 8.0.0 as affected and was unresolved in code review as of 2026-10-12. (low confidence) (verified as of 2026-10-12) [source]
Facts and statements
- Treat multiKeyPaths as index path metadata, not as the current query's constraints or scan range. It records array paths for the index and informs which bounds the planner can use; indexBounds shows the ranges that the IXSCAN actually searches, so read both fields together. (high confidence) [source]
Children
- path-level multikey tracking (frontier)
- positional index path caveat (frontier)
Frontier under this node: path-level multikey tracking, positional index path caveat