I am wondering about nscannedObjectsAllPlans/nscannedAllPlans in the output of mongodb explain(). As far as I understand, Mongo runs several plans (if available) and picks the fastest. The information about the plans are kept for another 100 writes. So, does this output mean that there were 12412 documents in the collection? That is not right. Because I just added a document and removed it from the collection and then the 12412 the nscannedObjectsAllPlans increased to 12412.
"cursor" : "BtreeCursor x_1",
"n" : 2301,
"nscannedObjects" : 12330,
"nscanned" : 12330,
"nscannedObjectsAllPlans" : 12412,
"nscannedAllPlans" : 12412,
"millis" : 98
After removing an object from the collection, the nscannedObjectsAllPlans is a ridiculous number "12412" which I don't understand the reason of. Can anybody explain this output of explain()