| Steps To Reproduce: |
use test
|
db.test.insert({a : 1, b : 2, c : 3})
|
db.test.insert({a : 2, b : 3, c : 4})
|
db.test.insert({a : 3, b : 4, c : 5})
|
db.test.insert({a : 1, b : 3, c : 4})
|
db.test.insert({a : 1, b : 4, c : 5})
|
On MongoDB 3.0.2
> db.test.find({a : 1, b : {$in : [] }}).explain(true)
|
{
|
"queryPlanner" : {
|
"plannerVersion" : 1,
|
"namespace" : "test.test",
|
"indexFilterSet" : false,
|
"parsedQuery" : {
|
"$and" : [
|
{
|
"a" : {
|
"$eq" : 1
|
}
|
},
|
{
|
"b" : {
|
"$in" : [ ]
|
}
|
}
|
]
|
},
|
"winningPlan" : {
|
"stage" : "COLLSCAN",
|
"filter" : {
|
"$and" : [
|
{
|
"a" : {
|
"$eq" : 1
|
}
|
},
|
{
|
"b" : {
|
"$in" : [ ]
|
}
|
}
|
]
|
},
|
"direction" : "forward"
|
},
|
"rejectedPlans" : [ ]
|
},
|
"executionStats" : {
|
"executionSuccess" : true,
|
"nReturned" : 0,
|
"executionTimeMillis" : 0,
|
"totalKeysExamined" : 0,
|
"totalDocsExamined" : 5,
|
"executionStages" : {
|
"stage" : "COLLSCAN",
|
"filter" : {
|
"$and" : [
|
{
|
"a" : {
|
"$eq" : 1
|
}
|
},
|
{
|
"b" : {
|
"$in" : [ ]
|
}
|
}
|
]
|
},
|
"nReturned" : 0,
|
"executionTimeMillisEstimate" : 0,
|
"works" : 7,
|
"advanced" : 0,
|
"needTime" : 6,
|
"needFetch" : 0,
|
"saveState" : 0,
|
"restoreState" : 0,
|
"isEOF" : 1,
|
"invalidates" : 0,
|
"direction" : "forward",
|
"docsExamined" : 5
|
},
|
"allPlansExecution" : [ ]
|
},
|
"serverInfo" : {
|
"host" : "angshuman-macbook.local",
|
"port" : 30000,
|
"version" : "3.0.2",
|
"gitVersion" : "6201872043ecbbc0a4cc169b5482dcf385fc464f"
|
},
|
"ok" : 1
|
}
|
On MongoDB 2.6.9
db.test.find({a : 1, b : {$in : [] }}).explain()
|
{
|
"cursor" : "BasicCursor",
|
"isMultiKey" : false,
|
"n" : 0,
|
"nscannedObjects" : 5,
|
"nscanned" : 5,
|
"nscannedObjectsAllPlans" : 5,
|
"nscannedAllPlans" : 5,
|
"scanAndOrder" : false,
|
"indexOnly" : false,
|
"nYields" : 0,
|
"nChunkSkips" : 0,
|
"millis" : 0,
|
"server" : "angshuman-macbook.local:30000",
|
"filterSet" : false
|
}
|
On MongoDB 2.4.13
> db.test.find({a : 1, b : {$in : [] }}).explain()
|
{
|
"cursor" : "BasicCursor",
|
"isMultiKey" : false,
|
"n" : 0,
|
"nscannedObjects" : 0,
|
"nscanned" : 0,
|
"nscannedObjectsAllPlans" : 0,
|
"nscannedAllPlans" : 0,
|
"scanAndOrder" : false,
|
"indexOnly" : false,
|
"nYields" : 0,
|
"nChunkSkips" : 0,
|
"millis" : 0,
|
"indexBounds" : {
|
|
},
|
"server" : "angshuman-macbook.local:30000"
|
}
|
|