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 1vBzxS-007kgE-PP for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Oct 2025 18:22:42 +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 1vBzxR-00AxDb-GV for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Oct 2025 18:22:40 +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 1vBzxR-00AxDS-6o for pgsql-hackers@lists.postgresql.org; Thu, 23 Oct 2025 18:22:40 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vBzxN-003r2q-32 for pgsql-hackers@postgresql.org; Thu, 23 Oct 2025 18:22:39 +0000 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-b3dbf11fa9eso241402666b.0 for ; Thu, 23 Oct 2025 11:22:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761243756; x=1761848556; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=mC5IWNBkkHIM0K2FSjDbxv9UPNkpYPbRxYNwASVKy7o=; b=hjhCINnl2gFJPJobnlS80pg+fodA6Zq/7W1jn6W8WlBSUOfddL6yKmQuXTlA0lssnJ QuQD7T+qxvdgP4A8koKPSQ1RfX5GruiAziH/O3SrW3m7cbPwlV9XpyeLEbpFk+hviQtj yNZBUHw//2QL6ZPYIYlck5SuxPcXYjyd0+Z6/rwyrOS+9tOu+4es53KlMTDNlZmri4m1 YdgVGQw+QS6kzg59/jS5zvfOnP5DwU/ZfuOEAWeysxd8aOL1VGyRUTH9ydFalgcHz64C iLrT5rHAd+5EzgQQSvD+S8EujprYhsI7ZVjJlbEeRpE2A3S4WpNDUxd2U3oe3dcuzENr oVNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761243756; x=1761848556; h=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=mC5IWNBkkHIM0K2FSjDbxv9UPNkpYPbRxYNwASVKy7o=; b=RBKm2EwEK1Ycwn1gn5EWPxo7DVN3u49bcvxDxTU2gG73vLIsf8kasris/cxu3eKDNc K2DS8nhwdNioZhB+e0j9V8QygLNHK1ICrYa8GMu+Ul7d74PJ7xGH8yDji5vShybBEdyG 5c7N4Ab7+4NJKn4ZHlX1iW3tR/USnBHVPog47bcWGbdN6oQz4HRiL97pJcYar0+j8I43 cEqbfnBDmUk0Jl61wvykqnj0X6TJNkLmKYoJiGcyMFFa+O06OWgOIqDuOP0/v0d3nSS8 LrENEBpEQYfNRoDCodwdR8Lq2fV+CyDFu/qJ12W84ikPKwsKTRATihAoHCwQUT4F2AMi HY/w== X-Forwarded-Encrypted: i=1; AJvYcCVxdeSGnExIbVRI2+jlzilrbTujnI2KCnJZ9/wIkgNWx6irGb8kjeLw4ahY2A0vwjDHz0/VPGaVPBPe5ENX@postgresql.org X-Gm-Message-State: AOJu0Ywx26FNaY0yvbT4SA0klLLdcAxFlACvEk6BkKHlhymxwA+Pjtpw fKeXve6jR2/2lyf/mPJ6X9bhDbiLeWWdujI3pHa/BCC341p6W6ZA3LH3t8y/Nix2EHqGa1vtmMX A7EE2eLt73AGdqdsGmWsYbAJvZCb6xfw= X-Gm-Gg: ASbGncv6bxLsJO3mda890aTAXfiqnGQkhkB7KQrFchO8aqoDFLTAPd3Nd8z9UrA7f4b r4RsFkfNfwheUaQV6S3LY9Cu6ucyPU16uUoNrr64rw0Ean7vBcNykqggYvqPTU7DSUcXOmYVA0a +K69a307nceRvGLj1/4wYHi9CdODgXxnj7ffUoeDB6sjSYn3WJ6wbWpOIUblOB6XJEfhzcaY28c sqlmzkkRp37sjKjby/Ecf42cBVH52pkrceJd7D5MXZJNwYn4Z/9eFXdS7A= X-Google-Smtp-Source: AGHT+IE6TSq2XN/mdV3zRJ4EirTUkfEZL0n0iiwVi0QaNvqg9OZb3ThdmVJmJ44YAwHKC3BqdclI1VWxxN67QXllGII= X-Received: by 2002:a17:906:730d:b0:b49:96e4:1845 with SMTP id a640c23a62f3a-b64739521a3mr3181457766b.41.1761243755744; Thu, 23 Oct 2025 11:22:35 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Sami Imseih Date: Thu, 23 Oct 2025 13:22:24 -0500 X-Gm-Features: AWmQ_bmKs_udjfai3AcdVjAcWxjHXqIKYuERhRc5QLDIuUPmG1VQW1BVBUZ7W8w Message-ID: Subject: Re: another autovacuum scheduling thread To: Nathan Bossart Cc: David Rowley , Robert Haas , Jeremy Schneider , pgsql-hackers@postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > > I think the one I proposed in [1] does this quite well. The table > > remains eligible to be autovacuumed with any score >= 1.0, and there's > > still a huge window of time to freeze a table once it's over > > autovacuum_freeze_max_age before there are issues and the exponential > > scaling once over failsafe age should ensure that the table is top of > > the list for when the failsafe code kicks in and removes the cost > > limit. > > Yeah. I'll update the patch with that formula. I was looking at v3, and I understand the formula will be updated in the next version. However, do you think we should benchmark the approach of using an intermediary list to store the eligible tables and sorting that list, which may cause larger performance overhead for databases with hundreds of tables that may all be eligible for autovacuum. I do think such cases out there are common, particularly in multi-tenant type databases, where each tenant could be one or more tables. What do you think? -- Sami