Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tXndD-00ERtq-Hz for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Jan 2025 20:35:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tXndC-003x1E-33 for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Jan 2025 20:35:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tXndB-003x14-IB for pgsql-hackers@lists.postgresql.org; Tue, 14 Jan 2025 20:35:22 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tXnd9-000Pyy-2k for pgsql-hackers@lists.postgresql.org; Tue, 14 Jan 2025 20:35:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1736886918; bh=fQLzFye03U4NE8vodS/kz4HkxS03tP58I8CX+j9Nfng=; h=Message-ID:Date:User-Agent:Subject:To:Cc:References:From: In-Reply-To:From; b=0mW9u+LHaOycY4HSKD53A1/bqTanXJj/rdryF/AFM5wcslh5OrJCpJNf/9tkPWcGw x7MAaJUBOWoMSyKy/lPPPCYRxcq9p2sOBKxTNy0EuHQ7ZQ+51tV4PikfxUWYnGh56A 36LcArcIoULQn1aiJrVwhpCaUsMmqCdxDCiBP91TzVBFWOtNKHvY/n8q0dxdIhW6xQ +7idxl8uuhH7VC8qlwF4SsyDS3gqoFbGZ8WSr5M0P8H8+1+u2HGHyLwwrwk43dFYZe VejaO0zYcA6W9fl1wlgElSWsHkHJ+f7fg2AjVznIwXmjons2EJbMB8AQ41Iv0cD25i b1OtgO/jbnQTw== Received: from [172.30.48.90] (unknown [172.30.48.90]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: a.rybakina@postgrespro.ru) by mail.postgrespro.ru (Postfix/587) with ESMTPSA id 0C038601EE; Tue, 14 Jan 2025 23:35:18 +0300 (MSK) Content-Type: multipart/alternative; boundary="------------ZRfHn8nzAxWJf60DfMsqOcVK" Message-ID: Date: Tue, 14 Jan 2025 23:35:17 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: New GUC autovacuum_max_threshold ? To: Nathan Bossart Cc: Sami Imseih , Robert Treat , =?UTF-8?Q?Fr=C3=A9d=C3=A9ric_Yhuel?= , wenhui qiu , Robert Haas , "Imseih (AWS), Sami" , David Rowley , Joe Conway , Michael Banck , Laurenz Albe , Melanie Plageman , PostgreSQL Hackers References: <2ca7f9c7-5da9-46cb-9072-39b71bfab948@dalibo.com> <93f3dab5-caa4-4213-9be0-855d5aaa19bf@dalibo.com> Content-Language: en-US From: Alena Rybakina In-Reply-To: X-KSMG-AntiPhishing: NotDetected X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.1.0.7854, bases: 2025/01/14 18:20:00 #27022932 X-KSMG-AntiVirus-Status: NotDetected, skipped X-KSMG-LinksScanning: not scanned, disabled by settings X-KSMG-Message-Action: skipped X-KSMG-Rule-ID: 1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------ZRfHn8nzAxWJf60DfMsqOcVK Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 --------------ZRfHn8nzAxWJf60DfMsqOcVK Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

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
--------------ZRfHn8nzAxWJf60DfMsqOcVK--