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 1w5WHJ-003Keo-1S for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Mar 2026 22:00:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w5WHH-00Gslm-2u for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Mar 2026 22:00:40 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w5WHH-00Gsle-23 for pgsql-hackers@lists.postgresql.org; Wed, 25 Mar 2026 22:00:40 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w5WHG-000000012Oi-1M6d for pgsql-hackers@postgresql.org; Wed, 25 Mar 2026 22:00:39 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-48702d51cd0so3762145e9.2 for ; Wed, 25 Mar 2026 15:00:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774476037; cv=none; d=google.com; s=arc-20240605; b=JlRTQ+RhGDlHHW9l2HHJol7vqZxQjF7kgb5IvYdw/k47N5UhXFC7KSEZW/5DM9H4b/ BT/MA+Jy0wP/8KAY0HRTYIUwG0ZEFUKiU8jlpKCzzUkZ2IlfqSTaBzzQ1SlpigCkIBRE 4L/SKxiacB4TWz5u+6brAf+QkP6sxnwCAvmBzvFhWiY48SQ+/wm07Y7XZkgTJaxX+Rks T1+ThL+aGauxPZNctV7L1ugrZ8vxNsKWpOJRtsi731WPh9akSKrhNLXVqdNxmK0uip4R xe7DZ/KdfwnRXcpTcgsiUa0ADTpQBFvb2JpB5aoYoaWKsa5WDSqFxarOuCKh1P/bbVml eYGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=GB+JWWDa/WKPRBNvrhkmI16NTCQNykGHB6x3LcP5G78=; fh=nUEqPZbuR9RijBrbiQWEJhIYLtCp3ow5m/hXMS0uvgM=; b=A/m+6t7wO10RdDgehHFZ0cYZlz80vzae/qUgeoMVv84WsPXHW8FH5IGMWmOl5W0gr/ Wl1x6CSJ3s3mI6cwShnKAuuv7/7CoDxqtOceA9fXmp79G/sDsMCajEJP5GY1NzS2byUT iEet4vJKrjLf5O3osSuhNeo9rkhpbMkuQd5Vo/5fJVJnpZDj+CJSjKCfzj9qStoyXyp+ djVTI7r/n7UOfaV6sHMxxiUWfVOq+6gUULBye52mEAZt+NmpBQJGlWQhkUiKsynWLdY5 J0Qu7H83B4p5SvF8EFNlnt59NNP9MPvBDDHYTYR9unSUX8YyEwFswd5qj4cQU1/prASx Ox0A==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774476037; x=1775080837; 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=GB+JWWDa/WKPRBNvrhkmI16NTCQNykGHB6x3LcP5G78=; b=GqKK4+OWweUgmGK+f9AE0qzzI13FNDXcSLahxgpu5fJBQ4xQLqdDdtbEaeWvXAilRq ihxGrWD9gbMHbpVpiMR91HAJw36L/JSumMwWufA2TRntyvRSqZ/4NH4IGFqQx9gFwTAL xK/LT1dKvYmxu1GNWz//suozHH21UTvOBvhqa9AYD8fPeVYVj4XXs7H8QoUHYoyLjU1l cOJaQ96k9BwFNqk6V84vUXxYWBI25t5xq2j3JAT1Qod84GyhNlTuDITEaK63/vWTIzJN Jble4Izx+CnoSGz1tQ2Db2YA1c6er3A8CdFrVVhKBcza99gx7PluLU+rd7ThfUE+E02y UF2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774476037; x=1775080837; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=GB+JWWDa/WKPRBNvrhkmI16NTCQNykGHB6x3LcP5G78=; b=sXm0jLQJ/or7UkU7Ap9M6/UZgHdU1nf9E+CGgqsitFBOkE2RUfQZIgzvrc0RKzsL3Z LQQUStFxHQFgEPDikfji9daW0OZ4+re2uiDKUordSsvx+fJpCXnos6IrZfQpXl4mCuYQ aifZxhAjc1zBHnACe+k7DYhobeX37SJMpii/Fu0IXYVeZFNfh8wg2FLGLZWt2Z7X1OwZ L7QgDf6eGqoQt9KnOWGxiVULEmvQ5/5vWv+CBzDcJcjDwII/yBvQ6z+3Cr/5R5+EOhEn GgNGwo0/ozZEjH7zug//SUL0zt7uMGnTPipv3zO1Heb9/rWdw1WHjuB9lF43IrRopgDx 0Khg== X-Forwarded-Encrypted: i=1; AJvYcCVCobiV0Gq8Wp/jL+pxjf7ZIteRyI8tkGy8RwjJhweBd0ArtxDVjjcpzhTd2WikVQjYTtp/6loNLwMaFus/@postgresql.org X-Gm-Message-State: AOJu0YyhdKO1We1OTJi5MNxc+fiZhMlf92CSuc0u/DLyv1M5h9EnOiXH bapSc++mWCMfRIMDcFyb64jm6Ci5hhaBINGdF9NIHI7JNT54ucJ5rU2CZDe+oG8foLfejpV0Rdm z3M7/xjT/V9wBEjyV3Nnr7ujtPi/wD7A= X-Gm-Gg: ATEYQzwbRRSME7NRxYE6Cdxzg2ofHLzffPQvza/zN5Z2ENmwY3extMYGBj5m+04iQ+8 gWgDiQmK+uJJOXjJy645kN+XLEIysin6oOby9az75DHpNn0a1XDjvOM9jmmxMT2NlA4lS3VfzpO JLW3mcP90H+10OnCioUQhDDEmiYngtaA2xdPnuF9O3IEvWCBra2lrtdQuYahRcua+4saBwQRhrW c/aIixx+Be4Kr6c+rCi3CZ5W/a0U1MifhS6nu/q26Jx2tjJHXzRSLfV54hsZBJDmax2oPLWebxx c88rk/zSVJSy3765FkhGvj0fRzy0q3DyJ+jMuQcbWlW5nrJAP+TWZwy0EPUoD2I71vT8/68d X-Received: by 2002:a05:600c:1e2a:b0:485:3423:727d with SMTP id 5b1f17b1804b1-4871606deb5mr80483775e9.26.1774476036494; Wed, 25 Mar 2026 15:00:36 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: David Rowley Date: Thu, 26 Mar 2026 11:00:24 +1300 X-Gm-Features: AQROBzBj7m8inEW2Sl7qp-INz2OHKo7QJPBLvnSf2I0Y5p_NJ4eglln9DAoUQjc Message-ID: Subject: Re: another autovacuum scheduling thread To: Nathan Bossart Cc: Bharath Rupireddy , Jim Nasby , Sami Imseih , Greg Burd , Robert Haas , Robert Treat , Jeremy Schneider , pgsql-hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 26 Mar 2026 at 10:18, Nathan Bossart wrote: > > On Wed, Mar 25, 2026 at 02:12:16PM -0700, Bharath Rupireddy wrote: > > Would it make sense to recompute scores and re-sort the remaining > > table list after each table is processed in do_autovacuum()'s main > > loop - say, after a certain amount of time spent vacuuming the large > > table(s)? This would catch the above scenarios. I see that the scores > > per table are being calculated in relation_needs_vacanalyze, but they > > are ignored in the recheck path (table_recheck_autovac -> > > recheck_relation_needs_vacanalyze -> relation_needs_vacanalyze). > > I think this was discussed a bit upthread, and we decided to leave it out > for now. But things like reprioritization and automatic cost limit > adjustments seem worth considering for v20. Agreed. I think the reason you mentioned in [1] was a good reason not to do this. There are also other autovacuum workers that may be calculating a more up-to-date list. They may well process the table that's increased score before the worker with the slightly stale list makes it there. That seems fine and natural to me. David [1] https://postgr.es/m/aROY-MUVO_mYTl2f%40nathan