MongoDB Explain Plans, Query Planner and Plan Cache

Parent: MongoDB Performance Troubleshooting · Published reference · snapshot 2026-10-19 · skill mongodb-expert/references/mongodb-explain-plans-and-query-planner.md

Also known as: Explain Plan Interpretation, Index Analysis, Index Analysis with $indexStats and Unused-Index Detection, Index Effectiveness Measurement, Query Planning and Plan Cache, Query Settings and Persistent Index Hints (8.0), Query Shapes and Query Hash and $queryStats, Slow Query Monitoring, Slow Query Monitoring (profiler and slow-query log and planSummary), explain-executionStats-usedDisk, hint() and Index Forcing

↓ Facts as markdownall context files

MongoDB explain output (queryPlanner, executionStats, allPlansExecution) details the plan the query optimizer selected and how it ran; the plan cache, query shapes with $queryStats, query settings and hint() steer or bypass that choice, and the database profiler, the slow query log and $indexStats measure what indexes actually did. Compiled from MongoDB manual, Atlas and Compass pages plus the run's verified claims; facets cover definitions, mechanisms, how-tos, problems and version changes.

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.

Definitions

Structure and components

How it works

How-to and procedures

Examples and snippets

Measurements and reference values

Problems, failure modes and limitations

Comparisons and alternatives

Facts and statements

Related concepts

Children

Frontier under this node: $natural hint and collection scans, Atlas Query Shape Insights, Persisting index usage metrics across restarts (PMM/monitoring) (2.85)

← the whole tree · 3D view· how to read this page