Re: db size and VACUUM ANALYZE

Поиск
Список
Период
Сортировка
От Amitabh Kant
Тема Re: db size and VACUUM ANALYZE
Дата
Msg-id 84b68b3d1002120918w3a6f6aa4r1ee7c40f58a0f53b@mail.gmail.com
обсуждение исходный текст
Ответ на db size and VACUUM ANALYZE  (Marcin Krol <mrkafk@gmail.com>)
Ответы Re: db size and VACUUM ANALYZE  (Marcin Krol <mrkafk@gmail.com>)
Re: db size and VACUUM ANALYZE  (Greg Smith <greg@2ndquadrant.com>)
Список pgsql-general
On Fri, Feb 12, 2010 at 10:40 PM, Marcin Krol <mrkafk@gmail.com> wrote:
Hello,

The db in the application I maintain but didn't write (it obviously
makes use of PG, v 8.3), has been systematically growing in size from
about 600M to 1.6G.

At the same time, the performance of the app has degraded significantly
(several times).

So I've done VACUUM ANALYZE on entire db. Nothing. The db did not
decrease in size, the performance stayed the same.

So I backed it up using pg_dump, deleted database, and recreated it from
backup.

The size of db on disk went down to 600M, performance recovered to the
original level.

Why that is so? I thought that VACUUM ANALYZE does everything that is
needed to optimize disk usage?

Regards,
mk
 

You need to do VACUUM FULL ANALYZE to claim the disk space, but this creates a exclusive lock on the tables.

See http://www.postgresql.org/docs/8.3/static/sql-vacuum.html


With regards

Amitabh Kant

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

Предыдущее
От: Marcin Krol
Дата:
Сообщение: db size and VACUUM ANALYZE
Следующее
От: Marcin Krol
Дата:
Сообщение: Re: db size and VACUUM ANALYZE