Re: autovacuum_freeze_max_age on append-only tables

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Senor <frio_cervesa(at)hotmail(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: autovacuum_freeze_max_age on append-only tables
Date: 2022-04-22 03:35:22
Message-ID: CAKFQuwaDHRfcKEQdAYtUc1=HBMv2QnAVgsULXpb1Qr=qj-7f9w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Apr 21, 2022 at 8:15 PM Senor <frio_cervesa(at)hotmail(dot)com> wrote:

>
> Are the autovacuum_vacuum_cost_* settings handled any differently for
> 'to avoid wraparound' vacuums?

> I understand that it won't give up a lock
> but I was expecting it to still back off due to cost and allow the query
> with conflicting lock to proceed.
>

IIUC "conflicting lock to proceed" is just a different way to say "give up
a lock".

In any case the cost-based stuff throttles I/O only (per the docs at least)
but even while sleeping it still holds its lock. And it won't be kicked
off of the lock by other processes. I don't see where it is documented
that the autovacuum cost settings are altered during the anti-wraparound
vacuum so I presume it will still sleep by default.

> Is there any benefit to manually running a vacuum every so many inserts
> as opposed to using autovacuum_freeze_max_age. And in this case should
> it be a vacuum freeze. Rows are never updated or deleted except for the
> occasional roll back due to dropped network connections.
>
>
You might consider creating a security definer function (that performs
vacuum freeze on the table) owned by the table owner and grant your
inserting process the ability to execute it.

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ram Pratap Maurya 2022-04-22 03:41:41 RE: Huge archive log generate in Postgresql-13
Previous Message Peter Geoghegan 2022-04-22 03:31:24 Re: autovacuum_freeze_max_age on append-only tables