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 1vC13c-007y4f-Ff for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Oct 2025 19:33:07 +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 1vC13b-00BGp5-4s for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Oct 2025 19:33:06 +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 1vC13a-00BGow-RC for pgsql-hackers@lists.postgresql.org; Thu, 23 Oct 2025 19:33:05 +0000 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vC13X-003rU5-1M for pgsql-hackers@postgresql.org; Thu, 23 Oct 2025 19:33:05 +0000 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-63c21467e5bso2157975a12.0 for ; Thu, 23 Oct 2025 12:33:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761247982; x=1761852782; 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=m2KHVQ96cWh0JGwusyRLkI1JLVJEMoUNdvNt9/tIkwA=; b=Di5zLCuysuXkRrdWhbQGGvSgcubm91vJ/IVFRdw4vjeb2PdzmWIZo1Cil9hsWetyKp taCQFvdw+6jRY8bu8a2gcH0xvjWljk7ovzhoRT648eq8MPfJ6I8LLwB//UeM/vv7aXnI hpQi015QOuAvyoWhklmzOO8slSu5DEU/ILUIYwsLWxX+yNCBbSuqDm8G9XrPmjyB2w0H pyCQK3Ik7zf4JuRfjdqkNQz08Fn/Wo+lAJYmYB9h02WfnMNmQaFv2Ee2v6rsU+4EPnf6 H6HkDSrovqaqNq5JC3KKpNXvEbEDynDvBQt7U988eRhdh9NAXIbZe9fRJf1kODX6mRzv YLpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761247982; x=1761852782; 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=m2KHVQ96cWh0JGwusyRLkI1JLVJEMoUNdvNt9/tIkwA=; b=KVCTT8m2CBoQa7z3p/1hIRIP8q7/71I6S8mTo4Xio8MA8RR1OFOgcnYTnBGKwcbOex rk9G0aYXUt+cxUxxGVx1DOW4grC0PhWa6Lt9rSYDlpiNwG/XFH5AonRDNMoILff2Cl7I B8hnCZ9iCE9N1A2orzHaPgWsSSwTH6G9ELX1fcIN4YLBU6/stxxW9j2HdAVUyH0MlzIN 7sQq4gbbGcdeNBqDUuQ/sagJlFN/oRj5eQkIE5QTkg4TzagjGcJMFIulA+n8EyGe7eVR rr6Pn7HV1vqsIWxbUrqG/YU5Kj42l4NpjH34mqRu4WpGWRtr755GuGbj+S5HMLTHzBmv ZBHA== X-Forwarded-Encrypted: i=1; AJvYcCWPf4+WnCMXOHlzCQmZE0QzZ1ZNB7EI7WfTFqzzvetxRjKMJp12Jygla0aYZS5BfTlmaZWwhJrLsKa+Kg1U@postgresql.org X-Gm-Message-State: AOJu0YxMslMgWdkVDJuc5MVZQch1g/SjxEp7Jewl/aeC5+hcx47KJfZC 53mY+tUoy4AOCfA96zNuB82hoBa3cNo4Jki6zMvcVeBAm+VfZKaURuFurN2/DoQ5/CcyaiHsEfw BxMYnxNjROGcfirECNNJHDRRZP2uDNtU= X-Gm-Gg: ASbGncuJ/Ihe8C0ydYlXNKXPn3rDJYThe8u2nE7fk3fH4DM0Db23hnOjUnA0QS47VEe 03arNfxEdkAix1l1SiBgPUJDPi8M/L0hq2sbwC6zso3kdcr4YZTkivcNZbYtdwDvqzUpeBx87GM nTKzEoWltqlnyfoR/w+fGe0jwJE0l+vYnjQFgF/67s91+jg+yYD+oAIdWgl4BaPM6M1wjeRHUIq bAKB3HXfXIuHPOKQJwg+4D9VXyCeyr5J9iEkFMInO/rs+qf46OAz6VhV0cM9MJUu/dc9s8= X-Google-Smtp-Source: AGHT+IHAvsLBJlo8Ep8Z7ekO9R4XwyzI4aILbqt4lXHMCc0pswJxVPl6IaVzwxu9PHgEEeevQJfv6BD/Aczq9Ay+pcg= X-Received: by 2002:a05:6402:f0f:b0:633:d0b7:d6d2 with SMTP id 4fb4d7f45d1cf-63c1f6b4fdbmr17697080a12.18.1761247981648; Thu, 23 Oct 2025 12:33:01 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Sami Imseih Date: Thu, 23 Oct 2025 14:32:50 -0500 X-Gm-Features: AWmQ_bkvh3WEonZPsWYCkeHXbvDRkcnzRmjUGzk1aSMmD2xjeTIHh9g0aX6txrE 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" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Thu, Oct 23, 2025 at 01:22:24PM -0500, Sami Imseih wrote: > > I was looking at v3, and I understand the formula will be updated in th= e > > 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 case= s > > out there are common, particularly in multi-tenant type databases, wher= e > > each tenant could be one or more tables. > > We already have an intermediary list of table OIDs, so the additional > overhead is ultimately just the score calculation and the sort operation. > I'd be quite surprised if that added up to anything remotely worrisome, > even for thousands of eligible tables. Yeah, you=E2=80=99re correct, the list already exists; sorry I missed that.= My main concern is the additional overhead of the sort operation, especially if we have many eligible tables and an aggressive autovacuum_naptime. I don=E2=80=99t think we shoul= d make the existing performance of many relations any worse with an additional sort. That said, in such cases the sort may not even be the main performance bottleneck, since the catalog scan itself already doesn=E2=80=99t scale well with many relations. With our current approach, we have more options to improve this, but if we add a sort, we may not be able to avoid a full scan. -- Sami