That comment is interesting.
You are right it's a bit bogus to do a transaction judt for performance - but i'm talking 10 minutes down to 4 for a batch n end of month process.
The PG documentation also talks about things being faster inside transactions due to this very issue.
And the only reason that I tried it is because there is no other way (I can see) to turn off auto commit mode.
If you can't turn it off is it a mode or a state of being ;)
The pl/pgsql function won't help since PG will call an fsync stright after it as well - and that is the only speed issue, not any query planning etc.
Ah. Well, now i'm going to try parallelizing it (I write to two tables) to see if that speeds it up...