Home > OS >  MognoDB what KeysExamined means?
MognoDB what KeysExamined means?

Time:01-29

MongoDB .explain("executionStats") shows keysExamined of something around 103,000 but I cant find out what it means.

CodePudding user response:

From MongoDB docs:

explain.executionStats.totalKeysExamined

Number of index entries scanned. totalKeysExamined corresponds to the nscanned field returned by cursor.explain() in earlier versions of MongoDB.

CodePudding user response:

  1. This are good news when you have totalKeysExamined > 0 , this mean your query is using index.

  2. If you have totalKeysExamined=0 , and totalDocsExamined>0 than you may need to create some indexes.

  3. The best case is when you have totalDocsExamined=0 and totalKeysExamined>0 , this is the case when you have the so called "covered query" , this is the fastest case where you search and load only from memory and do not touch the documents from storage.

  •  Tags:  
  • Related