Re: When do vacuumed pages/tuples become available for reuse?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: When do vacuumed pages/tuples become available for reuse?
Дата
Msg-id 8560.1554990486@sss.pgh.pa.us
обсуждение исходный текст
Ответ на When do vacuumed pages/tuples become available for reuse?  (rihad <rihad@mail.ru>)
Ответы Re: When do vacuumed pages/tuples become available for reuse?  (rihad <rihad@mail.ru>)
Список pgsql-general
rihad <rihad@mail.ru> writes:
> If an autovacuum job on a huge table runs for 5-6 hours, do its freed 
> pages/tuples become available for reuse immediately when they are marked 
> as free, or only at the end of the multi-hour vacuum operation?

They'll be freed in batches, where the size of a batch depends on the
autovacuum_work_mem or maintenance_work_mem setting.  The basic
work cycle is

* scan table to find dead tuples, save their TIDs in working memory;
  continue until end of table or working memory full
* scan indexes to find index entries matching those TIDs, remove 'em
* go back to table and remove the previously-found tuples
* if not end of table, repeat

So a larger work-mem setting means fewer passes over the indexes,
but a longer time until space is reclaimed.

            regards, tom lane



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

Предыдущее
От: Олег Самойлов
Дата:
Сообщение: Re: shared_buffers on Big RAM systems
Следующее
От: rihad
Дата:
Сообщение: Re: When do vacuumed pages/tuples become available for reuse?