Re: Stopping vacuum

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Stopping vacuum
Дата
Msg-id 2786.1088563307@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Stopping vacuum  (Werner Bohl <wbohl@deepdata.com>)
Список pgsql-admin
Werner Bohl <wbohl@deepdata.com> writes:
> We have a very big db that was not vacuumed for a long time. We started
> vacuum 3 days ago and it has not finished yet. There are some urgent
> processes that have to be run against the db.

> Is it safe to kill vacuum? It was started with 'vacuum full analyze'
> Is there anyway to speed it up at next start?

It is safe in the sense that your database won't be corrupted (were it
not safe, vacuum would be too dangerous to use at all --- think of power
failures for instance).

However, whatever work vacuum has done on the current table will be lost
and need to be done over when you run it again.  If the thing is stuck
on a particularly large and messy table then killing it could well be
counterproductive --- you might just be buying yourself an even longer
vacuum run next time.

I'd suggest identifying exactly which table it is currently working on
before you kill it.  Then look into alternate methods of compacting that
table.  It's entirely possible that CLUSTER would be a faster cleanup
method than VACUUM FULL.

            regards, tom lane

В списке pgsql-admin по дате отправления:

Предыдущее
От: 周仁军
Дата:
Сообщение: unsubscribe
Следующее
От: Tom Lane
Дата:
Сообщение: Re: How to list what queries are running in postgres?