Re: Does VACUUM ever free up any disk space?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Does VACUUM ever free up any disk space?
Дата
Msg-id 1380.1063314147@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Does VACUUM ever free up any disk space?  ("scott.marlowe" <scott.marlowe@ihs.com>)
Список pgsql-admin
"scott.marlowe" <scott.marlowe@ihs.com> writes:
> On Thu, 11 Sep 2003, Chris Miles wrote:
>> I've read a lot where people recommend using VACUUM FULL
>> to free up disk space, especially after many updates/inserts.

> A regular vacuum since 7.2 never actually frees up space, it simply marks
> the space in the file as available for reuse.  Note that in many
> circumstances this is actually better than freeing up the space, as it
> allows the database to store date without having to extend and possibly
> fragment the table.

Regular vacuum *will* shorten the table's file if (a) there are some
completely-empty pages at the end, and (b) it can get an exclusive lock
on the table without blocking.  This might be a relatively rare
condition in a heavily-used table.  But "never actually frees up space"
is incorrect.

You're correct that regular vacuum is designed around the idea of
maintaining a steady-state file size rather than trying very hard to
give space back to the OS.

            regards, tom lane

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

Предыдущее
От: Peralta Miguel-MPERALT1
Дата:
Сообщение: unsubscribe
Следующее
От: Andrew Biagioni
Дата:
Сообщение: Cross-DB linking?