Re: How overcome wait for vacuum full? - Mailing list pgsql-admin

From Alvaro Herrera
Subject Re: How overcome wait for vacuum full?
Date
Msg-id 20070515225313.GV12731@alvh.no-ip.org
Whole thread Raw
In response to How overcome wait for vacuum full?  (Nick Urbanik <nicku@nicku.org>)
Responses Re: How overcome wait for vacuum full?  (Nick Urbanik <nicku@nicku.org>)
List pgsql-admin
Nick Urbanik wrote:
> Dear Folks,
>
> I am running a full vacuum on a database.  It's taking longer than I
> hoped.  In particular, the vacuum still hasn't reached the table that
> will benefit most from the vacuum.
>
> Can I move the existing table to a backup, make a copy of the table
> back to its original name, restart the application, and run the vacuum
> on the backup?  Or can I reclaim the disk space by dropping the
> original after making a copy?
>
> If I can, without losing data, what is the best way to do that?
> I am reaching the end of the period when this database application can
> be disabled.
>
> I have never run vacuum full on such a large database (24G) and am
> desperate to get the application back online.

Instead of waiting a month for the time when you can take the
application offline (thus accumulating a month's worth of dead tuples),
run a non-full vacuum more often (say, once a day or more).  It doesn't
lock the table so the app can continue to be online while it runs.

If you have too many dead tuples and are desperate to get the table in a
reasonable non-bloated state, try CLUSTER instead of VACUUM FULL.  It
might finish faster.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

pgsql-admin by date:

Previous
From: Nick Urbanik
Date:
Subject: How overcome wait for vacuum full?
Next
From: Steve Holdoway
Date:
Subject: improve select performance...