Skip to content

Instantly share code, notes, and snippets.

@jennyd
Created February 6, 2014 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jennyd/8844665 to your computer and use it in GitHub Desktop.
Save jennyd/8844665 to your computer and use it in GitHub Desktop.
Timing hits import using INSERT IGNORE vs. ON DUPLICATE KEY UPDATE
time bundle exec rake import:all:hits
With all hits imported already and no updates to counts to make:
- master:
real 0m43.212s
user 0m8.517s
sys 0m1.288s
- hits_import_update_count:
real 0m47.302s
user 0m8.029s
sys 0m1.344s
With all hits for a day given a count of 0 in the database:
- master:
real 0m42.705s
user 0m8.513s
sys 0m1.416s
- hits_import_update_count:
real 0m45.955s
user 0m8.429s
sys 0m1.196s
With no hits imported already:
- master:
real 1m27.470s
user 0m8.297s
sys 0m1.152s
- hits_import_update_count:
real 1m29.526s
user 0m8.789s
sys 0m1.212s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment