Re: Vacuum and inserts

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: Mark Wilden <mark(dot)wilden(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Vacuum and inserts
Date: 2008-06-19 14:50:10
Message-ID: 12457.1213887010@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Michael Fuhr <mike(at)fuhr(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Volkan YAZICI 2008-06-19 14:54:32 Re: Logging Parameter Values
Previous Message Tom Lane 2008-06-19 14:39:28 Re: Logging Parameter Values