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 1v7Jfp-000mty-KZ for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Oct 2025 20:25:09 +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 1v7Jfn-00ECcT-3F for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Oct 2025 20:25:08 +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 1v7Jfm-00ECbs-Q3 for pgsql-hackers@lists.postgresql.org; Fri, 10 Oct 2025 20:25:07 +0000 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v7Jfl-001Tby-0R for pgsql-hackers@postgresql.org; Fri, 10 Oct 2025 20:25:07 +0000 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-b3d50882cc2so468017066b.2 for ; Fri, 10 Oct 2025 13:25:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760127904; x=1760732704; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=iK+osHEqPH3wmqBjJ/2Lc25fm6dOyjut5szGXK+FPRM=; b=TBfYdbhDkB6p08pS4m04POQUDqPF07I/uH97Eue8U2mxE1hL8F5DTMwcp3CSH3AqAA Xr9vSX49jyPnjCtyiYCJO8Wb6EyPoWMlq92pv0V6kp2xckY7oF61GzNcKuOlGt/ryzRx RVrAwiuRLCJLOTQqi/S6ET78hhKBf90OV85gx3vTDpMfmlx9LE7CpZrr8rb5r7aF8IOD zweRI7u2/tJs3aw6YW61DtKV50oSmQinLrLezoVUpokXe43PUSE7iDEMdiH3eLh06iXA RBwyPNQja2OH/R8g1Nz0BSBju8jM+bITci09gWMxEzvIJ0x/lyzjEKZcHx2U+F1UyIDj BOdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760127904; x=1760732704; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iK+osHEqPH3wmqBjJ/2Lc25fm6dOyjut5szGXK+FPRM=; b=gt/tYtb3qARNQi1sdogZbwY+v0Qz8iTM17e0hObRhAz99JnhE9sC5IJyOZpAGIA6n5 6ujB9ZzLUkHRpusUFGfH9SyFM4bcn/DsJqdbc9eRkXD63kXm9M1JumauKRGnPH79uvbj ccv68qzMvg1zWZ/mi5NcEFuQ0nG+IYpCMqpt6d0WfP1ZHsZgSJ2Ss2cUdb1//ph45z67 FDyQcYuXWtW2+3hvvlTLvdcxbQyGS37QcjxNm+CR0wGgnq+M9fNjcaUR6TVcx3xMOIa7 EgIqJ9EPRD1E9OLHH7vBGiAwZJ7NF8d4NMXIU5rTjcnV+3x9PfA7Sq6vNPc3IInn5xLY gnJQ== X-Forwarded-Encrypted: i=1; AJvYcCV5MYjTajVGNF97UDrRUWdfQ8GkkhKfcn6/98rF4tvflCxHiodQgAd617EGxTt2TnU+vW5gHe25efAbtlSN@postgresql.org X-Gm-Message-State: AOJu0YxxZVhkdEhMTdNlhpwFfxSuW6YF7FZI+xktqq3zgvsyPrQk3Yh+ TOADYTKtQU9qD0RniCQj9S7ztIf+9bQfhXqfYE4s2sxhfKKut0w51+WSIUN2yQJa59K56TinJ8X SFyRyMm51G83OmovE7g+EekTu6ssVZIE= X-Gm-Gg: ASbGncsrVgYFZCF+pFUPu7vy57TC0vPRMBRcXc00bGzM/Qoi1JRYsZKkIh2qfTfDMbi mQAivfRfNCN28S+xeKCfl5Wfc1QeQjFu0KhZ54+0RCew+wnj0qdmzYj/PO/xMCtcpgC70SiLtzl zDouNsoRsj4xXIUEYPs1ufa7auYwBySuwUo+ssgVvS7FLouApkwvwE10qXENLwEkHaluGQB+MaR MDpfDklvW4g1EvWYoHLrGzbUiwfqilNmC2Ymw== X-Google-Smtp-Source: AGHT+IEyYwLm5gmshBIZVNbFG873RfB3D7PI783RiJD4d9Cj2m6T5tNvanzGVM1ZnU/AaIibXgvlT2XC0RHf2qMIEG4= X-Received: by 2002:a17:907:72cf:b0:b44:7c83:cd9 with SMTP id a640c23a62f3a-b50ac0cc049mr1543267166b.40.1760127903623; Fri, 10 Oct 2025 13:25:03 -0700 (PDT) MIME-Version: 1.0 References: <20251008164057.6bceb9ed@ardentperf.com> <20251008172727.3befd129@ardentperf.com> <20251008182520.6e05a8b8@ardentperf.com> <20251008184740.328d45de@ardentperf.com> In-Reply-To: From: Robert Haas Date: Fri, 10 Oct 2025 16:24:51 -0400 X-Gm-Features: AS18NWBfut77qzUHYY3BdX1YnetWkiTXeBXCGQPVvBwhyaB0WtUnqXJn69blrsA Message-ID: Subject: Re: another autovacuum scheduling thread To: Nathan Bossart Cc: David Rowley , Jeremy Schneider , Sami Imseih , pgsql-hackers@postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Oct 10, 2025 at 3:44=E2=80=AFPM Nathan Bossart wrote: > On Fri, Oct 10, 2025 at 02:42:57PM -0400, Robert Haas wrote: > > I think this is a reasonable starting point, although I'm surprised > > that you chose to combine the sub-scores using + rather than Max. > > My thinking was that we should consider as many factors as we can in the > score, not just the worst one. If a table has medium bloat and medium > wraparound risk, should it always be lower in priority to something with > large bloat and small wraparound risk? It seems worth exploring. I am > curious why you first thought of Max. The right answer depends a good bit on how exactly you do the scoring, but it seems to me that it would be easy to overweight secondary problems. Consider a table with an XID age of 900m and an MXID age of 900m and another table with an XID age of 1.8b. I think it is VERY clear that the second one is MUCH worse; but just adding things up will make them seem equal. > Agreed. I need to think about this some more. While I'm optimistic that > we could come up with some sort of normalization framework, I deperately > want to avoid super complicated formulas and GUCs, as those seem like > sure-fire ways of ensuring nothing ever gets committed. IMHO, the trick here is to come up with something that's neither too simple nor too complicated. If it's too simple, we'll easily come up with cases where it sucks, and possibly where it's worse than what we do now (an impressive achievement, to be sure). If it's too complicated, it will be full of arbitrary things that will provoke dissent and probably not work out well in practice. I don't think we need something dramatically awesome to make a change to the status quo, but if it's extremely easy to think up simple scenarios in which a given idea will fail spectacularly, I'd be inclined to suspect that there will be a lot of real-world spectacular failures. --=20 Robert Haas EDB: http://www.enterprisedb.com