On Mon, Nov 10, 2025 at 02:03:27PM -0600, Nathan Bossart wrote:
> While working on my autovacuum scheduling patch [0], I noticed the
> following comment in relation_needs_vacanalyze():
> 
>         /*
>          * Note that we don't need to take special consideration for stat
>          * reset, because if that happens, the last vacuum and analyze counts
>          * will be reset too.
>          */
> 
> AFAICT this is a relic from pg_autovacuum (the contrib module and
> predecessor to modern autovacuum) [1] and early versions of the autovacuum
> patch [2] [3].  After digging through the archives [4], I think this is
> referring to some stats that had to be managed separately but weren't ever
> actually committed.

Patch attached.

> Any objections to removing this comment?

If none materialize, I will proceed with removal in a couple of days.

-- 
nathan
>From 2cbd42e1795daa273afdb4c54d089c764940c6d7 Mon Sep 17 00:00:00 2001
From: Nathan Bossart <[email protected]>
Date: Tue, 11 Nov 2025 13:55:44 -0600
Subject: [PATCH v1 1/1] remove obsolete autovacuum comment

---
 src/backend/postmaster/autovacuum.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/src/backend/postmaster/autovacuum.c 
b/src/backend/postmaster/autovacuum.c
index ed19c74bb19..1c38488f2cb 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -3158,11 +3158,6 @@ relation_needs_vacanalyze(Oid relid,
                        vac_ins_scale_factor * reltuples * pcnt_unfrozen;
                anlthresh = (float4) anl_base_thresh + anl_scale_factor * 
reltuples;
 
-               /*
-                * Note that we don't need to take special consideration for 
stat
-                * reset, because if that happens, the last vacuum and analyze 
counts
-                * will be reset too.
-                */
                if (vac_ins_base_thresh >= 0)
                        elog(DEBUG3, "%s: vac: %.0f (threshold %.0f), ins: %.0f 
(threshold %.0f), anl: %.0f (threshold %.0f)",
                                 NameStr(classForm->relname),
-- 
2.39.5 (Apple Git-154)

Reply via email to