Re: Shortening time of vacuum analyze - Mailing list pgsql-general

From Francisco Reyes
Subject Re: Shortening time of vacuum analyze
Date
Msg-id 20020130122242.K40489-100000@zoraida.natserv.net
Whole thread Raw
In response to Shortening time of vacuum analyze  (Francisco Reyes <lists@natserv.com>)
Responses Re: Shortening time of vacuum analyze  (Andrew Sullivan <andrew@libertyrms.info>)
List pgsql-general
On Wed, 30 Jan 2002, Andrew Sullivan wrote:

> On Wed, Jan 30, 2002 at 11:07:43AM -0500, Francisco Reyes wrote:
>
> > Nightly doing delete of about 6 million records and then re-merging.
> > Previously I was doing truncate, but this was an issue if a user tried to
> > use the system while we were loading. Now we are having a problem while
> > the server is running vacuum analyzes.
>
> I'm not sure I understand the problem of "issue if a user tried to
> use the system while we were loading".  I understand that, of course,
> the data is gone when you truncate; but won't it be anyway, if you
> delete?

You can put the delete/load inside a transaction so the users will never
see an empty table. Truncate can not be placed inside a transaction.

We basically do
begin transaction
delete
copy
commit transaction


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: process exited with status 11 after XLogFlush: request is not satisfied
Next
From: Fernando Lozano
Date:
Subject: pgsql, java and accents