C100DBA practice question 4 of 25
What does the totalKeysExamined field returned by the explain method indicate?
Full set: 130 questionsThe totalKeysExamined field is a crucial metric within the executionStats section of an explain() plan's output. It quantifies the number of index entries that MongoDB scanned to fulfill the query. A lower value for totalKeysExamined relative to the number of documents returned (nReturned) generally indicates a more efficient index usage, as the database had to inspect fewer index keys to locate the target documents. This metric is essential for diagnosing and optimizing query performance.
A: The number of documents that match the query condition and are returned to the client is indicated by the nReturned field. C: This describes the executionStages object, which provides a detailed, hierarchical view of the operations performed during query execution. D: The number of documents scanned from the collection after being identified via the index is reported in the totalDocsExamined field.
1. MongoDB Manual, "Explain Results". In the executionStats section, executionStats.totalKeysExamined is defined as the "Number of index entries scanned." (https://www.mongodb.com/docs/manual/reference/explain-results/#mongodb-explain-field-executionStats.totalKeysExamined)
2. MongoDB Manual, "Analyze Query Performance". This page explains how to use totalKeysExamined and totalDocsExamined to evaluate query efficiency. (https://www.mongodb.com/docs/manual/tutorial/analyze-query-performance/)
Keep practicing
Take the free C100DBA practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other C100DBA practice questions
- Question 1If the value of totalKeysExamined is 30000 and the value of totalDocsExamined is 0, which…
- Question 2The oplog (operations log) is a special capped collection that keeps a rolling record of …
- Question 3‘$set' sets the value of
- Question 5Which mongodb tools allow us to work with our data in a human readable format?
- Question 6Which of the following is incorrect statement about find and findOne operations in MongoD…
- Question 7In a sharded replicas set environment with multiple mongos servers, which of the followin…
