-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Querying
-
None
-
ALL
-
The executionStats for count() shows that totalDocsExamined is not 0 when a covered query contains an $in with multiple values in the array, but the equivalent find() has 0 totalDocsExamined.
db.keys_examined.explain('executionStats').find({x: "A", y: {$in: [1, 2]}}, {_id: 0, y: 1})
Returns the expected executionStats
"nReturned" : NumberInt(2),
"totalKeysExamined" : NumberInt(3),
"totalDocsExamined" : NumberInt(0)
db.keys_examined.explain('executionStats').count({x: "A", y: {$in: [1]}})
Returns the expected executionStats
"nReturned" : NumberInt(0),
"totalKeysExamined" : NumberInt(2),
"totalDocsExamined" : NumberInt(0)
db.keys_examined.explain('executionStats').count({x: "A", y: {$in: [1, 2]}})
I would expect that totalDocsExamined would still be 0, but executionStats returns
"nReturned" : NumberInt(0),
"totalKeysExamined" : NumberInt(3),
"totalDocsExamined" : NumberInt(2)
- duplicates
-
SERVER-17266 count command performance optimization should support more complex queries
- Backlog