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 1w4phY-002bId-33 for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Mar 2026 00:32:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w4phX-003EGB-0F for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Mar 2026 00:32:55 +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.96) (envelope-from ) id 1w4phW-003EG2-2O for pgsql-hackers@lists.postgresql.org; Tue, 24 Mar 2026 00:32:55 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w4phU-00000000mvW-37dA for pgsql-hackers@postgresql.org; Tue, 24 Mar 2026 00:32:54 +0000 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-43b3d9d0695so4364888f8f.0 for ; Mon, 23 Mar 2026 17:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774312372; cv=none; d=google.com; s=arc-20240605; b=gOZJUSPu0HtuM+o5ZsyD37FuKndFnXj3GOnakH6t90gNtsY7z9+tlPmkyyaY4ob4uE mCc7ZvAQQEMQoGo4edvqo4jAdLHqGXAR79oEtAa8f6CkGyqW5moN9I+cDnB+XoQZlS0t fdLaApNKe3zAMwduLON3O/17QIyvl/S5bNLR+5YBey8oQCP/YTsIr6ov0Anety8fceAI l4QKz70VWwDiEoPOq5Z+jt7HfIydAW8FPzX/jIoGGCwjfW6KsN2r+thXzQ94Hsc/RiPK GN/of6lHNTNRG9aoTkfwCgHxyVbZnsVetyUmTc253ukkMit8qEgoTM49qSLGx6SC334N Pe0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=MtwEwOuyp4qsni4OHJnF/DuSa6BLCyUqRC5nG0gQ3e0=; fh=OxZxEQr0FQA3gG3kEY36ccqMwUZOZHS5bfQRmoKOjsU=; b=TumFKi5Y0OTT1yRi4hlo9Y5uWQ8wgQvhDiXo5KMaFrDh4k40YDjyzTSekNDiBHgtbS bNMZFSAa5hcdFyd2EsCc5NW5oQmtVJZXTJb0j5nfZuOiv562tOijnD2AL8w0Nb9gU5fv h+OU89M3e6twVjuaoLtb26HS1bPXnf7YkuJrqcNg+E5gPvJFmFFSYJ7FDXFUwA5p9umz hdxZ+xDQdBtxkCGzavHjRsNEfnUBgviJiaXRGNdrl3lqi202/yGLnPRzjKxYzVr6folq 7DU1outc465vlLWBJlTZRXEI2LP+OPZmrT/gum9pkVwupIvdp8M3mEeDnyISrmm9KZn3 yWFA==; 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=1774312372; x=1774917172; 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=MtwEwOuyp4qsni4OHJnF/DuSa6BLCyUqRC5nG0gQ3e0=; b=Upi+zZCQre+PiT+WU3NTdAWtWSeTQ5+ccC9mY9Ml9c0gv0RSJ6uLQPdwpw/ltBlfcy uBgTVmDACzwan7JWjPVe4RJkjGP9A1pZY+IXNl/5/qv/fZpFmYHBlqwU48iuHptkuvJ0 vv+E5VHnE5LPRoP9jc1IqhTPBXVFA21BI454cUXOszu4c1TWbvSYyEEHj8TS+76Cn311 aRCm+bJsTjiK+m1kqKYndvNVikGqp5XlxzuKmj1q9w/ySTLkih4HfgKtfBaJtgCW4rom SOslrS//NdRSONgqs0+wG/axwrWV25/zAiL0wAGLzu78RhPiUqBRnFQcast5GIUfK5nr Zz0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774312372; x=1774917172; 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=MtwEwOuyp4qsni4OHJnF/DuSa6BLCyUqRC5nG0gQ3e0=; b=cgi6vRWQwCzEAf+sMtJ/M4yVeH6NSWrIv25lzq8KSRWjhSoQspfv8Vr16B0/Npv1Es AhQ7sxd3MmS18u3O2DkkQ6Ae7BV+acUB3t2Bz4NT/hB+dvInEI99RDx0Sdtfurq3466G dLaMXofW077ickDyjUNhEqlAiMMi/cn+J0DWCRaNdgE9gfhK6s2IhUsh1oY0Q2Bn2j3B gCCylHyxH7AYED83yPeWGW/hRfN3H1IH597F3IKi+QnmsPRI5g1VzOdWcrPPwaY26wru 7LqzB9fAY3bcRa9XyzysFgGrmWjX0WzqOZMb+Pr7M1S27WDWr19w77xrtE1amLllP7bz qjtA== X-Forwarded-Encrypted: i=1; AJvYcCWFeylik4hmVs3V6cPAePUQ0cwh7qI7BP4qbUZC0ks/XFtazfN8PuQd0nksTinCRQ2hLzrnhJLaBlpTgQqS@postgresql.org X-Gm-Message-State: AOJu0YwhbPJRP6CsUfNtqAN4p2GXpDGtwnlD2r8rmlkk3J77t/xixfjG iFbZDeL4NepzZNu3XyUJ4SfBAa87y0J/LTbWkRLYyyGRS9iGSYdUJ9W1hfLHuAjEWQH183XrNEM EyHIaHb1nZZHK8Z7UaRQmTXBjUeDHe3M= X-Gm-Gg: ATEYQzy0p3uWqC07fyAS2Ly79ptmSi7xDolGsOBh/FskH48YJfocK6D6Autmz4WJpLw syihc4OQjNsm7KP8rZRRZxxkSO/jTXEGJrOsooml9neV/LsA5/Vyi8xVimgJ6yIIUtG4K1vUxim 6zMevyUz1+d192YTJpq1wNka+TOFxC/8STRpoXiCXuBErrN50TOs/thSWD7rATP1COfdCFCmoeP lnuDOKSVBdIA8GmxFO7I3R9BqthGsINFnla39SeBiKF2HH1otx9DvqmmDHQEUbpnFqj3OxDygas KQHVGaEeMy9PkhekV9/3bnAOBO5KMKgtZqZPMoZpVC7YpzPBWPnYnqRQL34T2I5ZD2hTqzO7jS1 CIODIIkZp X-Received: by 2002:a5d:5f56:0:b0:439:c24b:ec15 with SMTP id ffacd0b85a97d-43b805316edmr2295445f8f.5.1774312372220; Mon, 23 Mar 2026 17:32:52 -0700 (PDT) MIME-Version: 1.0 References: <3ca1e398-c787-47e9-9afc-8e298b94dac0@app.fastmail.com> In-Reply-To: From: David Rowley Date: Tue, 24 Mar 2026 13:32:40 +1300 X-Gm-Features: AQROBzAveuO6BUUO-BYy4TFbDm1uKzV15kGWLvdiu_bvgOFctXUR1lnlxIjgX-M Message-ID: Subject: Re: another autovacuum scheduling thread To: Jim Nasby Cc: Nathan Bossart , Sami Imseih , Bharath Rupireddy , Greg Burd , Robert Haas , Robert Treat , Jeremy Schneider , pgsql-hackers 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, 24 Mar 2026 at 11:27, Jim Nasby wrote: > > On Mon, Mar 23, 2026 at 4:01=E2=80=AFPM Nathan Bossart wrote: >> Thanks. IMHO we should continue to focus on the main patch and get that >> committed first. > > > +1 ... for one thing if we're going to add a view meant for monitoring au= tovac decisions I'd like to think about ways to measure how many tables are= "close" to being eligible for autovac. In particular, the scenario where y= ou've just done an MVU via some form of logical, so now the freeze ages on = all your tables are extremely similar. +1 for main patch first. I do think a view would be useful as a follow-up. However, which columns we put in that view might have some influence on how the current patch should look. I think the view should show the individual scores and the total score as the Max() of the individual scores. If we didn't do that, it might be confusing to the user which aspect of the score the final score is derived from. That might mean that it'd be better to have relation_needs_vacanalyze() output the scores individually, or perhaps populate a struct that we pass in that gets allocated on the stack during do_autovacuum(). That'd mean a bit less churn if we go with the view containing individual scores. I think it would be good to have the view show tables that are not eligible for autovacuum too. It should be easy for users to filter those out for cases where they're not needed. Doing that would make it very easy for anyone who wanted to code up a script to run off-peak to vacuum tables that might need attention on the next peak. Something like: SELECT 'VACUUM ' || vacrelid::regclass || ';' from pg_stat_autovacuum_priority WHERE vacuum_score BETWEEN 0.75 AND 1.0 ORDER BY vacuum_score DESC; \gexec David