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.96) (envelope-from ) id 1w2tSm-000hoN-20 for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Mar 2026 16:09:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w2tSl-00CHjk-1c for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Mar 2026 16:09:39 +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.96) (envelope-from ) id 1w2tSl-00CHjc-0T for pgsql-hackers@lists.postgresql.org; Wed, 18 Mar 2026 16:09:39 +0000 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w2tSh-00000000xWP-3KCm for pgsql-hackers@postgresql.org; Wed, 18 Mar 2026 16:09:38 +0000 Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-7d756f2a06dso1069480a34.1 for ; Wed, 18 Mar 2026 09:09:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773850175; x=1774454975; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=JmF5q4iQNw9h0PhA+UmJfNhU34pHH2fE0ek+gD29Tyw=; b=LqIKHEZcWMtYm16zvYD+RP7s1XThqhBIRVRJuY2myZhmXllRTQlAWZ5IWFoVt4AV05 jJHopOKuEstCTnk5QU2HS71wrpRu1XYRAOUmm23YvZ7nALqr7G5qJH/HjDS6VoM/TxPF Vb4CjPyWYU4Hk3lhYyuGF2q/uFaanZRBQQSWTR2m91cFZA09IoVrYCPvn+qnsXwh01zi XpeRUTyOQUUzUDKiAny3zZWbdis898FheU5kv0Y8123DXH/VLbB2ZHZkNrJWiy0yrEj8 5b/a3+hiP0qKL+sVfWAFi8ze3wkf8qe0CZKL16hMF1rBNMgCm1Qs+D33mMmigDseLW0N EOVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773850175; x=1774454975; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JmF5q4iQNw9h0PhA+UmJfNhU34pHH2fE0ek+gD29Tyw=; b=DL9ETWA3UR5O0xe8lcNDKGfaSY9HVsHNP+hQ9wg1XtwnZEBfDxBpEUW5KVdMXCDe8/ p4tzXW2xaC+XYleUHl9pZtZPuQZqdyen6wF3gfyNlGeWqoTcAQX8tFUYn7fQqF4H7+/6 IvViMB8mUmdtwGMtWEb3ezEmbOEn7/HvJ2z53TM6Vb2ehfsGSWUgdgDZL9DmHPqbExLM BbOqC2c0lTr1WUPCzALSu5v3iCqHZClzlTxp345kSQZF81qBlnDtfUodjvBY5IUkKgWx nbq5Kkd1Y6W+ncLAI3dl12t1q1n77V9T8BySefQZzmgbXXqV+UpV0+D+HqG0vyiBzhAE aKHw== X-Forwarded-Encrypted: i=1; AJvYcCURorEjs5n4fLNFOty9T5dvsn/0hzYAAYRzTGBmc3IH//p8JY1CkBdR5Zd9fzeI+3s9ohvkDRcgT0o+IiE1@postgresql.org X-Gm-Message-State: AOJu0YwJdrDhfaUogbDGwmp8rh6t2pt2wbQ1xipQBLuJcnNzypmFkkEe U2hvTToXnFBntXKX2SG42xI9/nHY+Q0jKv5yuatwhYINbPvA+P0JEv7E X-Gm-Gg: ATEYQzzyliI3JoAoo+U5PazUSf3/ODrsEaCmob86cDALlHpkh3icl7U2I53JZdIVl2q e5UFk7I5BAe1XyEByfm6X0olsDrfzTSmy8TpTENiBs0E1pnTtTcm7O/X205veeXBIFYQQs2hC5U yYkQ/YsLARG8ocVAB7VmtPwJuDpONh9Qm++XNibWGFXLtw6CuD+g6C9SFoTK4k1NbaEe2KzJomk Sko9ZO63Io1vDksEhrNIUZyIFfv1STscwMgYJo+dMnlklxk2PNshDAMqzLu04sCkpXYBJRAnDZc qP/RUSsWpC/Hdjmbsx2Z/xp+gvlmpLl5iDfmZSRJgTWtJV0gasGilWkUyBUbwmw2CL5enq7fgo3 w0QEMXScmyQiw1eY7Nh8fjOg+1s8B2i4y+nQ918ceGswkutgOlmEGQYctUmNHvWrzvmLXiaIGvE gLjHOKTXAHfz/dhwPZWND73TxPpEYJG0ND5sgLh/alQPDQOIC863CNr6fk2BuloJHPe8NTyHT8q oRHqjaUz9GCEDoEcbbWqA4WKIjlsBeG X-Received: by 2002:a05:6830:c8:b0:7d7:4990:dc71 with SMTP id 46e09a7af769-7d7da6ce9b8mr61328a34.10.1773850174608; Wed, 18 Mar 2026 09:09:34 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7d7cb326c48sm2306626a34.23.2026.03.18.09.09.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Mar 2026 09:09:33 -0700 (PDT) Date: Wed, 18 Mar 2026 11:09:31 -0500 From: Nathan Bossart To: David Rowley Cc: Sami Imseih , Robert Haas , Robert Treat , Jeremy Schneider , pgsql-hackers@postgresql.org Subject: Re: another autovacuum scheduling thread Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="IwjnQr02zhZ5zNSb" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --IwjnQr02zhZ5zNSb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Mar 18, 2026 at 12:06:34PM +1300, David Rowley wrote: > I think it would have been better to have done this about 3 months > ago, but I think it's probably still fine to do now. Feature freeze is > still quite a long way from release. I do expect that the most likely > time that someone would find issues with this change would be during > beta or RC, as that's when people would give PostgreSQL production > workloads to try out. During the dev cycle, I expect it's *mostly* > just hackers giving the database toy workloads in a very targeted way > to something specific that they're hacking on. Anyway, now since > you've added the GUCs to control the weights, there's a way for users > to have some influence, so at least there's an escape hatch. Thanks for chiming in. > I think the GUCs are probably a good idea. I expect the most likely > change that people might want to make would be to raise the priority > of analyze over vacuum since that's often much faster to complete. We > know that some workloads are very sensitive to outdated statistics. > > On the other hand, we shouldn't be taking adding 5 new autovacuum GUCs > lightly as there are already so many. If we are going to come up with > something better than this in a few years then it could be better to > wait to reduce the pain of having to remove GUCs in the future. I > don't personally have any better ideas, so I'd rather see it go in > than not. Yeah, adding these GUCs feels a bit like etching in stone, but if folks want configurability, and nobody has better ideas, I'm not sure what else to do. > I didn't look at the patch in detail, but noticed that you might want > to add a "See Section N.N.N for more information." to the new GUCs to > link to the text you've added on how they're used. Good idea. I've added that. > Do you think it's worth making the call to > list_sort(tables_to_process, TableToProcessComparator) conditional on > a variable set like: sort_required |= (score != 0.0);? I recall that > someone had concerns that the actual sort itself could add overhead. I don't think it's necessary. I tested sorting 1M and 10M tables with randomly generated scores (on my MacBook, with assertions enabled). The former took ~150 milliseconds, and the latter took ~1770 milliseconds. I suspect there are far bigger problems to worry about if you have anywhere near that many tables. -- nathan --IwjnQr02zhZ5zNSb Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v12-0001-autovacuum-scheduling-improvements.patch