joeyadams/haskell-libpq — comment on commit b6968dac05961c8a3df937ff78174c9a0a7dfcf2
File:  line 0
By lpsmith:

When you say that COPY FROM is much faster than individual inserts, did you remember to put a transaction block around your insert statements? One transaction is going to be a *lot* faster than 50,000 transactions. Without an explicit transaction block, each individual insert statement is a transaction.

Also, did you test against an insert statement that inserted multiple rows at once? This has the added benefit of requiring fewer round trips between the client and the backend.

COPY FROM should still be faster than these, but I'm curious if you are doing a fair comparison here.