Re: Trigger more frequent autovacuums of heavy insert tables

From: Melanie Plageman <melanieplageman(at)gmail(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>, Peter Geoghegan <pg(at)bowt(dot)ie>, David Rowley <dgrowley(at)gmail(dot)com>, Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
Subject: Re: Trigger more frequent autovacuums of heavy insert tables
Date: 2025-02-25 22:19:30
Message-ID: CAAKRu_aaqvK4OUF=wAG1pY+WaQSutJqYM_wMDxUsWZ1op-J+jQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Feb 25, 2025 at 3:05 PM Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote:
>
> On Tue, Feb 25, 2025 at 01:52:28PM -0500, Robert Haas wrote:
> > Given that users could manually update the catalog, we have to be able
> > to tolerate bad data in the catalogs without the world ending. If that
> > code has to exist anyway, then it's not mandatory to cap. On the other
> > hand, there's no great virtue in refusing to correct data that we know
> > to be wrong. Unless there is some other consideration which makes one
> > way better than the other, this feels like author's choice.
>
> Maybe the most conservative choice is to simply follow the example of
> surrounding code. If it's careful to cap relallvisible to relpages, also
> have it cap relallfrozen. If not, don't. *shrug*

Agreed. I've done this in attached v10. I handle relallfrozen values >
relpages in the second patch in the set when using the relallfrozen
value, so I think we are all good.

> In any case, I don't want to hold up this patch on this relatively minor
> point. This seems like something we could pretty easily change in the
> future if needed.

Yes, so one thing you haven't said yet is if you are +1 on going
forward with these patches in general.

As for the code, I'm not 100% convinced I've got all the stats
import/export bits perfect (those are changing under my feet right now
anyway).

- Melanie

Attachment Content-Type Size
v10-0002-Trigger-more-frequent-autovacuums-with-relallfro.patch text/x-patch 5.2 KB
v10-0001-Add-relallfrozen-to-pg_class.patch text/x-patch 34.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2025-02-25 22:33:27 Re: Trigger more frequent autovacuums of heavy insert tables
Previous Message Masahiko Sawada 2025-02-25 22:14:19 Re: Parallel heap vacuum