Skip to content

Instantly share code, notes, and snippets.

@apeckham
Created August 26, 2015 04:58
Show Gist options
  • Save apeckham/ce5c44ad374c34c5f447 to your computer and use it in GitHub Desktop.
Save apeckham/ce5c44ad374c34c5f447 to your computer and use it in GitHub Desktop.
big sql update
create temporary table u (id int primary key, whatever varchar);
\copy u from 'out-file.csv' quote '"' csv
# 20 sec
update the_actual_table set whatever = u.whatever from u where the_actual_table.id = u.id
# 37 minutes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment