Re: VACUUM and read-mostly tables

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ian Westmacott <ianw(at)intellivid(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: VACUUM and read-mostly tables
Date: 2005-04-05 18:26:54
Message-ID: 26291.1112725614@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Ian Westmacott <ianw(at)intellivid(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Jim C. Nasby 2005-04-05 19:32:03 Re: VACUUM and read-mostly tables
Previous Message Ian Westmacott 2005-04-05 17:56:05 Re: VACUUM and read-mostly tables