-
Type: Bug
-
Resolution: Won't Fix
-
Priority: Minor - P4
-
None
-
Affects Version/s: 3.6.3
-
Component/s: Performance, Querying
-
Labels:None
-
ALL
I'm using mongodb 3.6.3 and my queries are fully covered by the _id index, e.g.
db.getCollection('inventory').find({ _id: "myid123"}, { _id: 1 })
Checking executionStats, totalDocsExamined is 1.
According to the executionStats, there is an IDHACK stage. If I manually specify the index to use
db.getCollection('inventory').find({ _id: "foobar"}, { _id: 1 }).hint( { _id: 1 } ).explain('executionStats')
I get an IDXSCAN stage instead and totalDocsExamined is 0. Is this desired behavior?