Re: Eagerly scan all-visible pages to amortize aggressive vacuum

From: Andres Freund <andres(at)anarazel(dot)de>
To: Melanie Plageman <melanieplageman(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Peter Geoghegan <pg(at)bowt(dot)ie>, Robert Treat <rob(at)xzilla(dot)net>
Subject: Re: Eagerly scan all-visible pages to amortize aggressive vacuum
Date: 2025-01-09 18:24:40
Message-ID: ed5zq4rwmtuv6l2fjseozwysftbhswe7ye63skwgc6qs2777nx@3kxldoymkocr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2025-01-07 15:46:26 -0500, Melanie Plageman wrote:
> For table storage options, those related to vacuum but not autovacuum
> are in the main StdRdOptions struct. Of those, some are overridden by
> VACUUM command parameters which are parsed out into the VacuumParams
> struct. Though the members of VacuumParams are initialized in
> ExecVacuum(), the storage parameter overrides are determined in
> vacuum_rel() and the final value goes in the VacuumParams struct which
> is passed all the way through to heap_vacuum_rel().
>
> Because VacuumParams is what ultimately gets passed down to the
> table-AM specific vacuum implementation, autovacuum also initializes
> its own instance of VacuumParams in the autovac_table struct in
> table_recheck_autovac() (even though no VACUUM command parameters can
> affect autovacuum). These are overridden in vacuum_rel() as well.
>
> Ultimately vacuum_eager_scan_max_fails is a bit different from the
> existing members of VacuumParams and StdRdOptions. It is a GUC and a
> table storage option but not a SQL command parameter -- and both the
> GUC and the table storage parameter affect both vacuum and autovacuum.
> And it doesn't need to be initialized in different ways for autovacuum
> and vacuum. In the end, I decided to follow the existing conventions
> as closely as I could.

I think that's fine. The abstractions in this area aren't exactly perfect, and
I don't think this makes it worse in any meaningful way. It's not really
different from having other heap-specific params like freeze_min_age in
VacuumParams.

Greetings,

Andres Freund

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2025-01-09 18:25:51 Re: [PATCH] Hex-coding optimizations using SVE on ARM.
Previous Message Nathan Bossart 2025-01-09 18:20:06 Re: New GUC autovacuum_max_threshold ?