Details
-
Bug
-
Resolution: Won't Fix
-
Minor - P4
-
None
-
3.6.3
-
None
-
ALL
Description
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?