From: Nathan Bossart Date: Mon, 6 Apr 2026 16:28:46 +0000 (-0500) Subject: Remove autoanalyze corner case. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e3481edfd1b6b0a64fef8f43cfa3b48e94c01682;p=thirdparty%2Fpostgresql.git Remove autoanalyze corner case. The restructuring in commit 53b8ca6881 revealed an interesting corner case: if a table needs vacuuming for wraparound prevention and autovacuum is disabled for it, we might still choose to analyze it. Research seems to indicate this was an accidental addition by commit 48188e1621, and further discussion indicates there is consensus that it is unnecessary and can be removed. Reviewed-by: Robert Treat Reviewed-by: Álvaro Herrera Reviewed-by: Sami Imseih Reviewed-by: Shinya Kato Discussion: https://postgr.es/m/adB9nSsm_S0D9708%40nathan --- diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 250c43b85e5..c4d6b8811bf 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -3338,15 +3338,6 @@ relation_needs_vacanalyze(Oid relid, scores->max = Max(scores->max, scores->anl); if (av_enabled && anltuples > anlthresh) *doanalyze = true; - - /* - * For historical reasons, we analyze even when autovacuum is disabled - * for the table if at risk of wraparound. It's not clear if this is - * intentional, but it has been this way for a very long time, so it - * seems best to avoid changing it without further discussion. - */ - if (force_vacuum && AutoVacuumingActive() && anltuples > anlthresh) - *doanalyze = true; } if (vac_ins_base_thresh >= 0)