intermediateMongoDB Performance Optimization — Explain Plan, Covered Queries & Pagination
What's the clearest signal in explain() output that a query is missing a useful index?
A large gap between totalDocsExamined and nReturned — it means MongoDB scanned far more documents than it actually needed to return, which is the direct symptom of a missing or unhelpful index for that query's filter shape.
This is a Pro chapter
Sign in, then upgrade to Pro or Power to unlock this and the full Databases Mastery library.
What's the clearest signal in explain() output that a query is missing a useful index?