Re: VACUUM FULL doesn't reduce table size

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: VACUUM FULL doesn't reduce table size
Дата
Msg-id 20150306142642.GY3291@alvh.no-ip.org
обсуждение исходный текст
Ответ на VACUUM FULL doesn't reduce table size  (pinker <pinker@onet.eu>)
Ответы Re: VACUUM FULL doesn't reduce table size  (pinker <pinker@onet.eu>)
Список pgsql-general
pinker wrote:
> I have deleted a large number of records from my_table, which originally had
> 288 MB. Then I ran vacuum full to make the table size smaller. After this
> operation size of the table remains the same, despite of the fact that table
> contains now only 241 rows and after rewriting it in classic way: CREATE
> TABLE new_table AS SELECT * FROM old_table - new_table size is 24kB.
> What went wrong? And how can I remove those blocks?

Normally this happens when you have transactions that are older than the
delete, so the deleted rows cannot be removed by vacuum because that
transaction might still see them. If you close all old transactions,
vacuum full would be able to reclaim all the space.  You might have
prepared transactions also, see select * from pg_prepared_xacts;

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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

Предыдущее
От: Patrick Dung
Дата:
Сообщение: Re: Find similar records (compare tsvectors)
Следующее
От: pinker
Дата:
Сообщение: Re: VACUUM FULL doesn't reduce table size