Created
March 5, 2011 07:58
-
-
Save skippy/856216 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.data_points.find({ sensor_id: 247, faulty: { $ne: true }, orig_relative_time: { $lte: new Date(1299305991280) }, deleted_at: { $exists: false } }).sort({ orig_relative_time: -1 }).limit(-1).explain() | |
{ | |
"cursor" : "BtreeCursor orig_relative_time_-1_sensor_id_-1", | |
"nscanned" : 11859, | |
"nscannedObjects" : 11859, | |
"n" : 11859, | |
"millis" : 1896, | |
"indexBounds" : { | |
"orig_relative_time" : [ | |
[ | |
"Sat Mar 05 2011 06:19:51 GMT+0000 (UTC)", | |
"Thu Jan 01 1970 00:00:00 GMT+0000 (UTC)" | |
] | |
], | |
"sensor_id" : [ | |
[ | |
247, | |
247 | |
] | |
] | |
} | |
} | |
> db.data_points.find({ sensor_id: 247, faulty: { $ne: true }, orig_relative_time: { $lte: new Date(1299305991280) }, deleted_at: { $exists: false } }).sort({ orig_relative_time: -1 }).limit(1).explain() | |
{ | |
"cursor" : "BtreeCursor sensor_id_-1_orig_relative_time_-1", | |
"nscanned" : 1, | |
"nscannedObjects" : 1, | |
"n" : 1, | |
"millis" : 0, | |
"indexBounds" : { | |
"sensor_id" : [ | |
[ | |
247, | |
247 | |
] | |
], | |
"orig_relative_time" : [ | |
[ | |
"Sat Mar 05 2011 06:19:51 GMT+0000 (UTC)", | |
"Thu Jan 01 1970 00:00:00 GMT+0000 (UTC)" | |
] | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I should note that the millis in the first explain is very high...the DB was getting hammered then so I suspect that is what caused it to be slow. After it warmed up it settled down, but still fairly high, in the 80-150 range