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

From Nathan Bossart
Subject Re: Disabling vacuum truncate for autovacuum
Date
Msg-id Z7Tl2d7HrG1AQEOc@nathan
Whole thread Raw
In response to Re: Disabling vacuum truncate for autovacuum  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Mon, Jan 27, 2025 at 03:38:39PM -0500, Robert Haas wrote:
> Also, how sure are we that turning this off globally is a solid idea?
> Off-hand, it doesn't sound that bad: there are probably situations in
> which autovacuum never truncates anything anyway just because the tail
> blocks of the relations always contain at least 1 tuple. But we should
> be careful not to add a setting that is far more likely to get people
> into trouble than to get them out of it. It would be good to hear what
> other people think about the risk vs. reward tradeoff in this case.

My first reaction is that a global setting is probably fine most of the
time.  I'm sure it's possible to get into bad situations if you try hard
enough, but that's not a unique characteristic.  There are probably many
situations where the truncation is wasted effort because we'll just end up
extending the relation shortly afterwards, anyway.  In any case, it's
already possible to achieve $SUBJECT with a trivial script that sets
storage parameters on all tables, so IMHO it would be silly to withhold a
global setting that does the same thing just on principle.

Of course, ideally we'd "fix" truncation on standbys, but that's at least
v19 work at this point, and past discussion from many years ago [0] leads
me to believe it's a difficult problem.  That's not to say we should shy
away from difficult problems...

[0] https://postgr.es/m/flat/CAHGQGwE5UqFqSq1%3DkV3QtTUtXphTdyHA-8rAj4A%3DY%2Be4kyp3BQ%40mail.gmail.com

-- 
nathan



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: AIO v2.3
Next
From: Tom Lane
Date:
Subject: Re: BUG #18815: Logical replication worker Segmentation fault