Created
August 24, 2011 00:11
-
-
Save eliwjones/1166973 to your computer and use it in GitHub Desktop.
mongodb Compound Index query wierdness.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mydb:PRIMARY> db.mycollection.find({propOne:869}).explain() | |
{ | |
"cursor" : "BtreeCursor propOne_1_propTwo_1_propThree_1", | |
"nscanned" : 8889642, | |
"nscannedObjects" : 8889642, | |
"n" : 804382, | |
"millis" : 11683, | |
"nYields" : 152, | |
"nChunkSkips" : 0, | |
"isMultiKey" : true, | |
"indexOnly" : false, | |
"indexBounds" : { | |
"propOne" : [ | |
[ | |
869, | |
869 | |
] | |
], | |
"propTwo" : [ | |
[ | |
{ | |
"$minElement" : 1 | |
}, | |
{ | |
"$maxElement" : 1 | |
} | |
] | |
], | |
"propThree" : [ | |
[ | |
{ | |
"$minElement" : 1 | |
}, | |
{ | |
"$maxElement" : 1 | |
} | |
] | |
] | |
} | |
} | |
mydb:PRIMARY> db.mycollection.find({propOne:869, propTwo:"my string name"}).explain() | |
{ | |
"cursor" : "BtreeCursor propOne_1_propTwo_1_propThree_1", | |
"nscanned" : 232225, | |
"nscannedObjects" : 232225, | |
"n" : 232225, | |
"millis" : 381, | |
"nYields" : 4, | |
"nChunkSkips" : 0, | |
"isMultiKey" : true, | |
"indexOnly" : false, | |
"indexBounds" : { | |
"propOne" : [ | |
[ | |
869, | |
869 | |
] | |
], | |
"propTwo" : [ | |
[ | |
"my string name", | |
"my string name" | |
] | |
], | |
"propThree" : [ | |
[ | |
{ | |
"$minElement" : 1 | |
}, | |
{ | |
"$maxElement" : 1 | |
} | |
] | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment