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 1w0N3T-001qoK-2e for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Mar 2026 17:09:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w0N3S-00APv4-0r for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Mar 2026 17:09:06 +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 1w0N3R-00APuv-3C for pgsql-hackers@lists.postgresql.org; Wed, 11 Mar 2026 17:09:06 +0000 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w0N3Q-00000001dj5-2qbU for pgsql-hackers@postgresql.org; Wed, 11 Mar 2026 17:09:05 +0000 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-65c4152313fso29218a12.1 for ; Wed, 11 Mar 2026 10:09:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773248943; cv=none; d=google.com; s=arc-20240605; b=Krmi8scpJHBWEm1SLH1YWSNkfZYM9nf7StOUjht8Afe/J+/fePkxcDZ5FXrYMLOUbm RgkP3iRlZJQCx80iAbIcOrMQOvowG5GaxG3qPlnj4rROR/q00XY95gvLtAG5PesHmbhh DUZYXOED9LeFgSkZFY4jTeTuLnqPvioH1d2wQQNyWR9B6J1izxPlK85At7btk1YThtzP 2PONFcAjmrsQ4u+OPeDv4MAd1nMKGdIrF997BZ8vgAgQYINfm6syi2h8tBQvMED8jgt/ k7n+gUti/XZ0KIO/OdwEJtit9PGXnsYH1ml4Qgs8zroHLqsRYrlkuk93quUNTy3aObsI yIfA== 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=4LaFr6YyfCFsTo5tXTpRmCWhf6KQnScDizl3jXxOx/w=; fh=VKWWGRkRb0dmjJGdqOzXxSkoFM/xKUIJbfHZzYGdfEA=; b=BZXk1++UvBKNlCmK/AppAqZRR5G1CHF5PupvlBn1hV/VVX3kCQHY2I7xDXexaoHoMH Ejo+skUxKQACdfOiv+ak4eRV0a1DdNX6bxZEwLvrRp6zLAhANtgJ20sWfL9H8OXJHukU 5W3nKJNorp3spFJejz9xEPMRinCHEcSC05SCz0JV/Gh9CQVlhDDVH8Dodcu4/d8ELX39 Hf27piIVDSfAtAhLevwcNR9QoFAumH4cQF5NqpzYNiZCSiVK970zi49ijTsDMuv56S3m lJRL/3fp5HtH+iuKgzygqbWLk1+gq+ZpFU9Yv+HvEuDHR+MKkV9pEflAMSjsQ91ozZca awPQ==; 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=20230601; t=1773248943; x=1773853743; 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=4LaFr6YyfCFsTo5tXTpRmCWhf6KQnScDizl3jXxOx/w=; b=mVaYH/UwFki9W6BDsNVWu2zSJvNelYzdpzswDr1ttgAE2rhNTqshx9P0WKGC4sW4ut itv3H0UuOdBL0HT1/qsF7rQRTgjwXhcrXf7R4VbPa0EEcR+5ichkatcUB4hyqFU8tIWV pG4t+Ef9oaGk+H/dXqU+cONV2RPcg2Wsu0yV4W6EWjfeI0sZurKvn0V+/ZIFl9ttUG1Y jIrjSaLvL9e0vtKJG/Xf5Zqkl3Ja41nFujODSd5L61pmsQVyq/Ea8PHp2gBXtcUDqh18 NVhItMxKVBTAG4Nsgk1++aXK9VnPp8Xoo2iOcUHCSJv7tqvV8b3GtgzsPfVSvfF38Sl+ TNyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773248943; x=1773853743; 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=4LaFr6YyfCFsTo5tXTpRmCWhf6KQnScDizl3jXxOx/w=; b=LM6vKcGhXSV+SOXuPj212PUUM9XfBp4/UeIwfnG5Cg/+BXAUk5H+ILw1jcnQLlC/et Y3IDgxewaNto0ztVZ8Ns1B6noGJq2o2a2kQ5EvvD/uaiBPBqKiyO5lbnhu4aC8eEr2bc yf4I+BxjU8CISDEsfNJ6fbp60qiYUHoY+nEGUOYzBmV0YtL0SSSgnC4j1CXmGfxCzPvn kuJH5E95p+Cs96xyJhO0j8vOKOX7CJD0eiJlP93xcH+jqRXXmLhrwmRQU+w9yotzeAD1 zackxGnWKbwA+B6StniZxBi/780AL2BGBVtKrkn827BT7o88DwNCvu0WgFScYd6Ul6e3 jSOw== X-Forwarded-Encrypted: i=1; AJvYcCWWnccd3vZg1I5hhMinbgrG5/f56VmFBKe+0BU9pOr4mujpQqJw6WXCdtp2pv/6ROwp50Fm4A+08SharM+w@postgresql.org X-Gm-Message-State: AOJu0YwOZqK9SEz7cXU49luqPyK4CX+BZhT0XHu+oGWxQhFFEvXQ+STq oqLf3/jFD0qiEzaAZz9eKHnM+VvW5bHwvbSOmdjfANvOrM59G+C8sS28ztLzgpRHgkyyzX9Lb1a L91STMdRfsUM9RmfaX/paS2yPOvQpEkw= X-Gm-Gg: ATEYQzxzgE00lf7evYaKT23Fvc22yyKFUh5GRCm9NpGDuRHfFqgSVH9UiQVvfMEPYGE fyCpO7vRntgnLtdB/H+S/opT5nY26fT7tkbjlBGytQMVQyo8isspKgELnEACJgsfI1SQJSVxt/a apvZ5hsc7bKr+w1HKz96M7lfNzHhoq4huYqH4Se8qd+d9DB0wOThuvolcwza8mNgGo5kswTn5yT VPVIe4ldB8toSBo85kFx+uvhy1ApG3Eq2/iYmjWIIleyggGyn45cjMAB5v7ucK0ritf5drLMmqL hG/yjQ== X-Received: by 2002:a05:6402:35c1:b0:660:f443:379a with SMTP id 4fb4d7f45d1cf-66319cd6aa5mr1831340a12.15.1773248943177; Wed, 11 Mar 2026 10:09:03 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Sami Imseih Date: Wed, 11 Mar 2026 12:08:52 -0500 X-Gm-Features: AaiRm51dpdwv8dowTln_wAsqFz02rF_4gaZnx3cUyAUk4jH1Cho8wSxNLGZX2gE Message-ID: Subject: Re: another autovacuum scheduling thread To: Nathan Bossart Cc: Robert Haas , David Rowley , Robert Treat , 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 > Good idea. I put my own spin on it in the attached. Please let me know > what you think. This look OK to me. > > The current scaling calculation for force_vacuum could lead to > > exorbitantly high scores. > > Using DEBUG3 and consume_xids_until(2000000000), notice how the score goes > > from 7.93 to 661828682916018.125 once past failsafe age. > > > > [...] > > > > Do you think it will be better to just to add the age to the > > score? > > I mean, that's kind of the point. Once a table surpasses one of the > failsafe thresholds, we want its score to be so exorbitantly high that > autovacuum is all but guaranteed to process it first. I see no particular > advantage to tempering the score in that case. The main issue is that the scores can reach quadrillions, or even billions, which feels excessive, especially if exposed in DEBUG3 or in a future prioritization view. So scaling the scores down seems like the right thing to do. We could also do this by dividing the score by a large constant, or use log10 to compress the score. Both methods should keep the sort order unchanged. However, If everyone agrees with the current approach, I will not push back further. -- Sami Imseih Amazon Web Services (AWS)