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

From: rihad <rihad(at)mail(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: When do vacuumed pages/tuples become available for reuse?
Date: 2019-04-11 14:01:23
Message-ID: 0522481c-4cf6-1928-8780-9bfa2d7c6aca@mail.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 04/11/2019 05:48 PM, Tom Lane wrote:
> rihad <rihad(at)mail(dot)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
> .
>
Thanks! Our autovacuum_work_mem = 1GB, so this probably means any space
would be available for reuse only at the end of the vacuum? Are there
any downsides in decreasing it to, say, 64MB? I see only pluses )

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2019-04-11 14:09:38 Re: When do vacuumed pages/tuples become available for reuse?
Previous Message Tom Lane 2019-04-11 13:48:06 Re: When do vacuumed pages/tuples become available for reuse?