Created
October 26, 2012 13:07
-
-
Save michaeltwofish/3958689 to your computer and use it in GitHub Desktop.
Slow query, extra field that the whole collection shares same value
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
> db.sittings.find({ "user.id" : "504fffe45c69233171000000", "status_id" : { "$in" : [ 1, 2 ] }, "app" : "schools", "metadata.client_id" : "4" }).explain() | |
{ | |
"cursor" : "BtreeCursor user.id_1", | |
"nscanned" : 4, | |
"nscannedObjects" : 4, | |
"n" : 4, | |
"millis" : 686, | |
"nYields" : 0, | |
"nChunkSkips" : 0, | |
"isMultiKey" : false, | |
"indexOnly" : false, | |
"indexBounds" : { | |
"user.id" : [ | |
[ | |
"504fffe45c69233171000000", | |
"504fffe45c69233171000000" | |
] | |
] | |
} | |
} | |
> db.sittings.find({ "user.id" : "504fffe45c69233171000000", "status_id" : { "$in" : [ 1, 2 ] }, "metadata.client_id" : "4" }).explain() | |
{ | |
"cursor" : "BtreeCursor user.id_1", | |
"nscanned" : 4, | |
"nscannedObjects" : 4, | |
"n" : 4, | |
"millis" : 0, | |
"nYields" : 0, | |
"nChunkSkips" : 0, | |
"isMultiKey" : false, | |
"indexOnly" : false, | |
"indexBounds" : { | |
"user.id" : [ | |
[ | |
"504fffe45c69233171000000", | |
"504fffe45c69233171000000" | |
] | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment