Re: New GUC autovacuum_max_threshold ?

Alena Rybakina <a.rybakina@postgrespro.ru>

From: Alena Rybakina <a.rybakina@postgrespro.ru>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Sami Imseih <samimseih@gmail.com>, Robert Treat <rob@xzilla.net>, Frédéric Yhuel <frederic.yhuel@dalibo.com>, wenhui qiu <qiuwenhuifx@gmail.com>, Robert Haas <robertmhaas@gmail.com>, "Imseih (AWS), Sami" <simseih@amazon.com>, David Rowley <dgrowleyml@gmail.com>, Joe Conway <mail@joeconway.com>, Michael Banck <mbanck@gmx.net>, Laurenz Albe <laurenz.albe@cybertec.at>, Melanie Plageman <melanieplageman@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-01-14T20:35:17Z
Lists: pgsql-hackers
Hi! Thanks for your work! it is very useful.

On 14.01.2025 05:09, Nathan Bossart wrote:
> On Mon, Jan 13, 2025 at 05:17:11PM -0600, Sami Imseih wrote:
>> I propose renaming the GUC from "autovacuum_max_threshold" to
>> "autovacuum_vacuum_max_threshold" to clarify that it applies only
>> to the vacuum operation performed by autovacuum, not to the analyze operation.
>> This will also align with naming for other related GUCs, i.e.,
>> "autovacuum_analyze_threshold" and "autovacuum_vacuum_threshold."
>>
>> The "vacuum threshold" calculation described in [1] will also need to be
>> updated.
> Good call.  Here is an updated patch.
>
I found one minor mistake in postgresql.conf:

#autovacuum_vacuum_max_threshold = 100000000    # max number of row updates
                         # before vacuum; -1 disables max
                         # threshold

I think instead of "# threshold" should be "#vacuum"?


There is a typo:

* if (threshold > vac_max_thresh)
* threshold = vac_max_thres; - here

I think you should add more information to the description of the 
Relations_needs_vacanalyze function: what is vac_max_thresh and how is 
it calculated. It is not clear what the below condition means.

/* -1 is used to disable max threshold */
vac_max_thresh= (relopts&& relopts->vacuum_max_threshold>= -1)
? relopts->vacuum_max_threshold
: autovacuum_vac_max_thresh;

-- 
Regards,
Alena Rybakina
Postgres Professional

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Introduce autovacuum_vacuum_max_threshold.

  2. Consolidate docs for vacuum-related GUCs in new subsection