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.
totalKeysExaminedcorresponds to thenscannedfield returned bycursor.explain()in earlier versions of MongoDB.
CodePudding user response:
This are good news when you have totalKeysExamined > 0 , this mean your query is using index.
If you have totalKeysExamined=0 , and totalDocsExamined>0 than you may need to create some indexes.
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.
