It seems to me that the only operators I see in a MongoDB query plan are COLLSCAN or IXSCAN. The indexes being b-tree, I guess MongoDB can do index seek and index scan ? If so, how do we know that a seek id performed ?
For instance, in this plan (just a fragment) :
"executionStats" : {
"executionSuccess" : true,
"nReturned" : 17,
"executionTimeMillis" : 42,
"totalKeysExamined" : 25359,
"totalDocsExamined" : 1553,
"executionStages" : {
"stage" : "FETCH",
"filter" : {
"address.zipcode" : {
"$eq" : "10075"
}
},
"nReturned" : 17,
"executionTimeMillisEstimate" : 30,
"works" : 25360,
"advanced" : 17,
"needTime" : 25342,
"needYield" : 0,
"saveState" : 198,
"restoreState" : 198,
"isEOF" : 1,
"invalidates" : 0,
"docsExamined" : 1553,
"alreadyHasObj" : 0,
"inputStage" : {
"stage" : "IXSCAN",
"filter" : {
"cuisine" : {
"$regex" : ".*alian",
"$options" : "i"
}
},
"nReturned" : 1553,
"executionTimeMillisEstimate" : 30,
"works" : 25360,
"advanced" : 1553,
"needTime" : 23806,
"needYield" : 0,
"saveState" : 198,
"restoreState" : 198,
"isEOF" : 1,
"invalidates" : 0,
"keyPattern" : {
"cuisine" : 1.0
},
"indexName" : "cuisine_1",
"isMultiKey" : false,
"multiKeyPaths" : {
"cuisine" : []
},
"isUnique" : false,
"isSparse" : false,
"isPartial" : false,
"indexVersion" : 2,
"direction" : "forward",
"indexBounds" : {
"cuisine" : [
"[\"\", {})",
"[/.*alian/i, /.*alian/i]"
]
},
"keysExamined" : 25359,
"seeks" : 1,
"dupsTested" : 0,
"dupsDropped" : 0,
"seenInvalidated" : 0
}
I can guess it is a scan (I did a regexp search on purpose) :
"totalKeysExamined" : 25359,
"totalDocsExamined" : 1553,
but I see
"seeks" : 1,
Is there any rule as how to interpret the plan, and why there is no IXSEEK operator ?