Created
February 28, 2013 10:52
-
-
Save jeremyvdw/5055886 to your computer and use it in GitHub Desktop.
This file contains 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.players.find( { team_id: { $in: ["phi"] } }).sort({last_name: 1}).explain() | |
{ | |
"cursor" : "BtreeCursor team_id_1", | |
"isMultiKey" : false, | |
"n" : 37, | |
"nscannedObjects" : 37, | |
"nscanned" : 37, | |
"nscannedObjectsAllPlans" : 74, | |
"nscannedAllPlans" : 74, | |
"scanAndOrder" : true, | |
"indexOnly" : false, | |
"nYields" : 0, | |
"nChunkSkips" : 0, | |
"millis" : 0, | |
"indexBounds" : { | |
"team_id" : [ | |
[ | |
"phi", | |
"phi" | |
] | |
] | |
}, | |
"server" : "xxxxxxx" | |
} | |
> db.players.ensureIndex({ team_id: 1, last_name: 1}) | |
> db.players.find( { team_id: { $in: ["phi"] } }).sort({last_name: 1}).explain() | |
{ | |
"cursor" : "BtreeCursor team_id_1_last_name_1", | |
"isMultiKey" : false, | |
"n" : 37, | |
"nscannedObjects" : 37, | |
"nscanned" : 37, | |
"nscannedObjectsAllPlans" : 37, | |
"nscannedAllPlans" : 37, | |
"scanAndOrder" : false, | |
"indexOnly" : false, | |
"nYields" : 0, | |
"nChunkSkips" : 0, | |
"millis" : 0, | |
"indexBounds" : { | |
"team_id" : [ | |
[ | |
"phi", | |
"phi" | |
] | |
], | |
"last_name" : [ | |
[ | |
{ | |
"$minElement" : 1 | |
}, | |
{ | |
"$maxElement" : 1 | |
} | |
] | |
] | |
}, | |
"server" : "xxxxxxx" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment