Re: How overcome wait for vacuum full?

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Nick Urbanik <nicku(at)nicku(dot)org>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: How overcome wait for vacuum full?
Date: 2007-05-15 22:53:13
Message-ID: 20070515225313.GV12731@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Steve Holdoway 2007-05-15 23:08:10 improve select performance...
Previous Message Nick Urbanik 2007-05-15 22:13:56 How overcome wait for vacuum full?