"scott.marlowe" <scott.marlowe@ihs.com> writes:
> 3: Inserting ALL 700,000 rows in one transaction is probably not optimal.
> Try putting a test in every 1,000 or 10,000 rows to toss a "commit;begin;"
> pair at the database while loading. Inserting all 700,000 rows at once
> means postgresql can't recycle the transaction logs, so you'll have
> 700,000 rows worth of data in the transaction logs waiting for you to
> commit at the end.
That was true in 7.1.0, but we got rid of that behavior *very* quickly
(by 7.1.3, according to the release notes). Long transactions do not
currently stress the WAL storage any more than the same amount of work
in short transactions.
Which is not to say that there's anything wrong with divvying the work
into 1000-row-or-so transactions. I agree that that's enough to push
the per-transaction overhead down into the noise.
regards, tom lane