Skip to content

Instantly share code, notes, and snippets.

@comerford
Created November 17, 2014 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save comerford/1d9300a6e8a47bd3d012 to your computer and use it in GitHub Desktop.
Save comerford/1d9300a6e8a47bd3d012 to your computer and use it in GitHub Desktop.
Timed explain with execution for MongoDB 2.8
// the start/end is not really needed since explain contains timing information
// but, this is useful for comparison with other commands (touch) which do not have such info
var start = new Date().getTime();
db.data.find().explain("executionStats")
var end = new Date().getTime();
print("Time to touch data: " + (end - start) + "ms");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment