News for hackers. Stuff that matters.
Re:Friends don't let friends use loops by meritt on Wednesday July 30, 2014 @07:16PM (#8111528)
This is a specific PostgreSQL command. While it is indeed faster it's not very maintainable and will definitely need rewriting for any other database. For example, with MySQL, you could write to a temp file and execute a "LOAD DATA INFILE".

Not entirely seeing the real benefit achieved here though.

Re:Friends don't let friends use loops by dragonwriter on Wednesday July 30, 2014 @07:51PM (#8111671)
> This is a specific PostgreSQL command.

You could reduce database roundtrips in a somewhat similar manner by doing a single-statement multi-row insert (I don't know if the particular DB library here supports multi-row inserts, but Postgres does and if its an FOSS library the lack of support is fixable) without resorting to the vendor-specific bulk copy command used in the article (which also has semantic differences from INSERT which might surprise people who are lured into thinking it is a semantically-equivalent performance optimization.)