Re: How overcome wait for vacuum full?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: How overcome wait for vacuum full?
Дата
Msg-id 20070515225313.GV12731@alvh.no-ip.org
обсуждение исходный текст
Ответ на How overcome wait for vacuum full?  (Nick Urbanik <nicku@nicku.org>)
Ответы Re: How overcome wait for vacuum full?
Список 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 по дате отправления:

Предыдущее
От: Nick Urbanik
Дата:
Сообщение: How overcome wait for vacuum full?
Следующее
От: Steve Holdoway
Дата:
Сообщение: improve select performance...