Skip to content

Instantly share code, notes, and snippets.

@danpoltawski
Created February 16, 2014 04:55
Show Gist options
  • Select an option

  • Save danpoltawski/9029458 to your computer and use it in GitHub Desktop.

Select an option

Save danpoltawski/9029458 to your computer and use it in GitHub Desktop.
time to switch to mongodb?
danp@bart:~$ time psql shouldirun -c "SELECT COUNT(DISTINCT(identifierforvendor)) FROM request_info"
count
-------
45543
(1 row)
real 0m6.880s
user 0m0.003s
sys 0m0.003s
danp@bart:~$ time mongo --quiet shouldirun --eval "printjson(db.request_info.distinct('identifierforvendor').length)"
45543
real 0m0.700s
user 0m0.031s
sys 0m0.011s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment