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 1vIuHG-002Dla-1y for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Nov 2025 19:43: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 1vIuHE-007K3f-0M for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Nov 2025 19:43: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 1vIuHD-007K3W-1z for pgsql-hackers@lists.postgresql.org; Tue, 11 Nov 2025 19:43:39 +0000 Received: from mail-vs1-xe2a.google.com ([2607:f8b0:4864:20::e2a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vIuH6-006b33-23 for pgsql-hackers@postgresql.org; Tue, 11 Nov 2025 19:43:38 +0000 Received: by mail-vs1-xe2a.google.com with SMTP id ada2fe7eead31-5dbcc814b80so64067137.3 for ; Tue, 11 Nov 2025 11:43:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xzilla-net.20230601.gappssmtp.com; s=20230601; t=1762890212; x=1763495012; 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=ey9a5q4DfIiIqupH6ioggLWO64g0fFEc8qOUqo55J1o=; b=BMAIW5fQsYOaztHOYEK+qrkIFOR2EcgkOTWO+fwj4QHAzxUbt0kH5dwhRbhtLRIgmX pAjTShT9DG4pxd+giTr1GX217nfdEoPV81RTAUCqZdy3d5ztTN903jnQGq6hYsVnXND8 qWmRHFej6mfZOnxTIPuU62+lxPVKpcCwxpmj0Sc6Ir8keqnm/xoWlcq44FPq38Dmp8GG llMtyKQ37rWDIJR+UbLTvmQHgcVHZjda6/3XSaCnPouE4WiJrltVdA2baas/N5u/6AZC 4Jmb+czVKu3xj+CoCL5SckmdJGzQ8EWNr7twIzaUsGs/RtduBFw89iNBsV4rseyuWeRq sbOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762890212; x=1763495012; h=content-transfer-encoding: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=ey9a5q4DfIiIqupH6ioggLWO64g0fFEc8qOUqo55J1o=; b=PBNowFjYBg5/ef2ubtk1xUqsrndCgrwZhaWQiiIytlw5md4/oghvdorjGgDURnpKxi sPGdrxc4tvqpUQH+g1gXzS6aqHhqH10k9FUFkW3IPodZYPpxh+g8wdRHjgikh0xNJXy3 BWeFTqi4b7UVhJgCig9qvAg8Jl51eu56y+LhHWzZyRZY15t/Wv2e9Qwh+LU7hhf4+h4o CW9+rfUQd6HkHtFgxWuMJIA3JcBWduJRo6rMdayleHu0HaXfuYASOyOfGnJHnd/XJGzQ bwDO1ikW/qwNJTi0cvjroHZRTM2RF9fSJSqSNqoJZ/11LophP9MtdWktTVhM7ZCUmPFP uLSQ== X-Forwarded-Encrypted: i=1; AJvYcCWtnNgI36t+KbbESdgnDi1ej4KGSFeXrcDsNdhBNCb0KWvl1gsBLXGwXCaU2ReSyenmhyxvOJnPWWaSZM9J@postgresql.org X-Gm-Message-State: AOJu0Yyh0ZJ3m2K9VTO9NMn0aN0M55mInY9r+XE0xF0SqeqHmUsVxHJY zjZ/rv4JCg/6t8KYr3QamdUSc5zcs7YrjXv3BQafqrcSSO+l5n7s0cnhygreGWab2YAfPimtlgR 343FidB8fgI/68h6H6zTwO1shk3sXThQr9c/PAZe1Sw== X-Gm-Gg: ASbGncs8XQ/7BO5a1F5Rp/oo2WAMcmpz7gVe6KsC/Eoppya+/QmSxpiP3W1L6D76HQf kX0WvYE1IKqwWjOiMRn0Af8KbKDRpv5rSm37rcwtLUgdX/m36mbUG1Scoiu5QIGBAluXXuxBM/U c/IuLMyS8RDPgoGCtaVBWvRjd+Q7bQS8wDYYNKjeaSO6A5kLHomIlIdgFbvvXCY4cYqnH9jDCck oAtFaTkQct+vrWnhzsleETcjDeU+z2uY7SucGiN5s6QKroo3AnbBttjFYALkN5V6FODrsk= X-Google-Smtp-Source: AGHT+IEdesrplhYXu1oBojRDktHXet/h0Il0llUzLiKUgHddFlihNk2mGS9xV28gdxRtOT+SC3dP42Ek3L2Ns1qu3Bc= X-Received: by 2002:a05:6102:b0f:b0:5d3:fed4:ac2b with SMTP id ada2fe7eead31-5de07cd5da6mr94844137.1.1762890211623; Tue, 11 Nov 2025 11:43:31 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Robert Treat Date: Tue, 11 Nov 2025 14:43:19 -0500 X-Gm-Features: AWmQ_bmqRCI90VSuUiH6ViQPJJKJTkAv7yEnLU5qkKgjjoq3YSD4-5rL-4i-Nog Message-ID: Subject: Re: another autovacuum scheduling thread To: Nathan Bossart Cc: David Rowley , Sami Imseih , 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 Tue, Nov 11, 2025 at 11:36=E2=80=AFAM Nathan Bossart wrote: > > Still catching up on the latest discussion, but here's a v8 patch that > amends the DEBUG3 in relation_needs_vacanalyze() to also log the score. = I > might attempt to add some sort of brief documentation about autovacuum > prioritization next. > > From skimming the latest discussion, I gather we might want to consider > re-sorting the list periodically. Is the idea that we'll re-sort the > remaining tables in the list, or that we'll basically restart > do_autovacuum()? If it's the latter, then we'll need to come up with som= e > way to decide when to stop for the current database. Right now, we just = go > through pg_class and call it a day. > FWIW, when I have built these types of systems in the past, and when I wanted an aggressive recheck-type mechanism, the most common methods involved tying it to autovacuum_max_workers. This usually was done under the assumption that generating the list was relatively cheap and that higher xid age would generate higher priority candidates. Of course I also was biased towards having it be user controllable at the database level (ie. no need to modify some control file or cron job or whatever). To the degree those things are aligned here, there is at least some anecdata that this is a usable setting. Robert Treat https://xzilla.net