Re: unused item pointers? - Mailing list pgsql-performance

From Jeffrey W. Baker
Subject Re: unused item pointers?
Date
Msg-id 1124774108.6978.7.camel@noodles
Whole thread Raw
In response to unused item pointers?  (Alan Stange <stange@rentec.com>)
List pgsql-performance
On Mon, 2005-08-22 at 22:51 -0400, Alan Stange wrote:
> Hello all,
>
> what are unused item pointers and how do I get rid of them?
>
> We have a fairly large table which is vacuumed daily and reindexed every
> weekend.

> as you can see we have 235M unused item pointers in the main table and a
> few 10's of millions more in other associated tables.
>
> Please note that the advice "vacuum more often" is a non-starter as the
> total time here is already about 3 hours and this is just one table.
> This is a fairly active table to which about 20M rows are added and
> removed daily.

That may be so, but the answer is still to VACUUM more often.  Try the
autovacuum.  If it takes 3 hours with 90% wasted records, it would only
take 20 minutes when running properly.

You might be able to change your application to avoid generating so many
dead rows.  For example, test before insert so you don't make a dead
tuple on duplicate insert.

To repair this table, you can try VACUUM FULL but this is likely to take
longer than you find reasonable.  I would recommend dump and reload.

-jwb


pgsql-performance by date:

Previous
From: Josh Berkus
Date:
Subject: Re: pgbench
Next
From: John A Meinel
Date:
Subject: Re: extremly low memory usage