Re: Disabling vacuum truncate for autovacuum - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: Disabling vacuum truncate for autovacuum
Date
Msg-id Z9ROT9v4rHjDYWNX@nathan
Whole thread Raw
In response to Re: Disabling vacuum truncate for autovacuum  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Responses Re: Disabling vacuum truncate for autovacuum
Re: Disabling vacuum truncate for autovacuum
Re: Disabling vacuum truncate for autovacuum
List pgsql-hackers
On Thu, Mar 06, 2025 at 08:54:59AM +0900, Fujii Masao wrote:
> +1 to having the reloption (if specified) override the GUC setting.
> That is, I think that autovacuum_vacuum_truncate as defining
> the default behavior for VACUUM truncation, and that the GUC should
> only apply when neither the TRUNCATE option in VACUUM nor
> the reloption is set.

One other difference in my version of the patch [0] is to call this GUC
vacuum_truncate and have it apply to both autovacuum and VACUUM.  I did
this for the following reasons:

* There is no autovacuum-specific storage parameter.  There is only
  vacuum_truncate and toast.vacuum_truncate, both of which apply to
  autovacuum and VACUUM.  Unfortunately, adding autovacuum-specific storage
  parameters at this point would break things for folks who are already
  using vacuum_truncate to prevent autovacuum from truncating.  In any
  case, I gather that we try to ordinarily keep storage parameters named
  the same as their corresponding GUCs.

* I'm not sure whether there's a real need to control the autovacuum
  default but not the VACUUM one.  I'd expect most users of this stuff to
  be worried about truncation in both cases, especially for the hot standby
  use-case mentioned upthread.

I should also mention that we just have a few weeks left in the v18
development cycle.  The code itself seems pretty straightforward, so if we
can agree on behavior and nomenclature, I'll do my darndest to get this
responsibly committed in time.

[0] https://postgr.es/m/attachment/172951/v2-0001-Add-vacuum_truncate-GUC.patch

-- 
nathan



pgsql-hackers by date:

Previous
From: Christoph Berg
Date:
Subject: Re: Available disk space per tablespace
Next
From: "David E. Wheeler"
Date:
Subject: PG_CFLAGS rpath Passthrough Issue