Re: New GUC autovacuum_max_threshold ?
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: Alena Rybakina <a.rybakina@postgrespro.ru>
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-02-03T19:51:15Z
Lists: pgsql-hackers
Attachments
I had the opportunity to bring this patch up for discussion at the developer meeting at FOSDEM PGDay last week [0]. We discussed a subset of the topics folks have already written about in this thread, and AFAICT there was general approval among the attendees for proceeding with the "hard cap" approach due to its user-friendliness. Given that, I am planning to commit the attached patch in the near future (although I may fiddle with the commit message a bit more). On Tue, Jan 14, 2025 at 11:35:17PM +0300, Alena Rybakina wrote: > #autovacuum_vacuum_max_threshold = 100000000 # max number of row updates > # before vacuum; -1 disables max > # threshold > > I think instead of "# threshold" should be "#vacuum"? That would more closely match the description of autovacuum_vacuum_insert_threshold, which refers to "insert vacuums," but I felt it would be weird to refer to "max vacuums." IMHO it is clearer to say that -1 disables the maximum threshold here. > There is a typo: > > * if (threshold > vac_max_thresh) > * threshold = vac_max_thres; - here Fixed. > 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; I looked at the commentary for this function and felt that the comments for this new parameter are in line with the comments for all the adjacent parameters. There may be an opportunity to improve this commentary, but IMHO that would be better handled in a separate patch that improved it for all these parameters. [0] https://2025.fosdempgday.org/devmeeting -- nathan
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Introduce autovacuum_vacuum_max_threshold.
- 306dc520b9df 18.0 landed
-
Consolidate docs for vacuum-related GUCs in new subsection
- ca9c6a5680d7 18.0 cited