What is the primary benefit of using a Covered Query in MongoDB?
When an index contains all fields required by a query, MongoDB returns the data directly from the index. This removes the need to perform a costly disk fetch to retrieve the full document, significantly reducing I/O operations and improving the overall latency and throughput of the query.
Why this answer
A covered query is one where all the fields in the query projection exist within the index itself. Because the database can retrieve all necessary data directly from the index tree without needing to fetch the actual document from disk, it drastically reduces I/O. This is one of the most effective ways to optimize read performance for high-frequency queries in large collections.
Exam trap
Candidates often confuse covered queries with regular index scans, mistakenly believing that any query using an index avoids disk reads. However, fetching documents that are projected outside the index still requires reading from disk.