Ian Westmacott <ianw@intellivid.com> writes:
> On Tue, 2005-04-05 at 11:34, Tom Lane wrote:
>> Have you looked at whether you can slow down the rate of XID consumption
>> (ie, by bundling operations into larger transactions)? That might be a
>> more useful route to limiting the costs involved.
> Yes, I'd like to explore that. Essentially what happens
> now is that a number of rows are written to each of about
> two dozen tables, each with a COPY FROM STDIN, and then
> there are a few INSERTS and UPDATES to boot. As far as
> we are concerned, all of this could be a single transaction.
> My understanding is that all the inserts resulting from a
> COPY are a single transaction, but is it possible to make
> multiple COPYs a single transaction?
Sure. Just wrap BEGIN/COMMIT around the whole mess. There are only
a very small number of commands that can't be inside a transaction
block.
Keep in mind also that SELECT queries are also transactions;
so you might need to think about bundling read operations too.
regards, tom lane