Re: Vacuum and inserts - Mailing list pgsql-general

From Tom Lane
Subject Re: Vacuum and inserts
Date
Msg-id 12457.1213887010@sss.pgh.pa.us
Whole thread Raw
In response to Re: Vacuum and inserts  (Michael Fuhr <mike@fuhr.org>)
List pgsql-general
Michael Fuhr <mike@fuhr.org> writes:
> On Wed, Jun 18, 2008 at 12:29:46PM -0700, Mark Wilden wrote:
>> My theory is that since there are no outdated nor deleted rows, VACUUM
>> doesn't do anything.

> Rolled back transactions on an insert-only table can leave behind
> dead rows.  Also, even if the table never has dead rows you still
> have to vacuum periodically to prevent transaction ID wraparound.

Another reason why you might want to vacuum after a bulk insertion
is to get all the commit hint bits set, rather than leaving that
overhead to be done by live queries.

In 8.4 there might be yet another reason, if you have a GIN index
on the table: Teodor is talking about postponing some of the GIN
insertion work to VACUUM ...

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Logging Parameter Values
Next
From: Volkan YAZICI
Date:
Subject: Re: Logging Parameter Values