]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Add elevel parameter to relation_needs_vacanalyze().
authorNathan Bossart <nathan@postgresql.org>
Fri, 3 Apr 2026 22:04:28 +0000 (17:04 -0500)
committerNathan Bossart <nathan@postgresql.org>
Fri, 3 Apr 2026 22:04:28 +0000 (17:04 -0500)
This will be used in a follow-up commit to avoid emitting debug
logs from this function.

Author: Sami Imseih <samimseih@gmail.com>
Discussion: https://postgr.es/m/CAA5RZ0s4xjMrB-VAnLccC7kY8d0-4806-Lsac-czJsdA1LXtAw%40mail.gmail.com

src/backend/postmaster/autovacuum.c

index 93dee70c1deb0adcc5d5668d4cdc764ea2f22574..8400e6722cc4cfcea9b2145fd4ac3be26642b683 100644 (file)
@@ -378,6 +378,7 @@ static void relation_needs_vacanalyze(Oid relid, AutoVacOpts *relopts,
                                                                          Form_pg_class classForm,
                                                                          PgStat_StatTabEntry *tabentry,
                                                                          int effective_multixact_freeze_max_age,
+                                                                         int elevel,
                                                                          bool *dovacuum, bool *doanalyze, bool *wraparound,
                                                                          AutoVacuumScores *scores);
 
@@ -2075,6 +2076,7 @@ do_autovacuum(void)
                /* Check if it needs vacuum or analyze */
                relation_needs_vacanalyze(relid, relopts, classForm, tabentry,
                                                                  effective_multixact_freeze_max_age,
+                                                                 DEBUG3,
                                                                  &dovacuum, &doanalyze, &wraparound,
                                                                  &scores);
 
@@ -2175,6 +2177,7 @@ do_autovacuum(void)
 
                relation_needs_vacanalyze(relid, relopts, classForm, tabentry,
                                                                  effective_multixact_freeze_max_age,
+                                                                 DEBUG3,
                                                                  &dovacuum, &doanalyze, &wraparound,
                                                                  &scores);
 
@@ -2993,6 +2996,7 @@ recheck_relation_needs_vacanalyze(Oid relid,
 
        relation_needs_vacanalyze(relid, avopts, classForm, tabentry,
                                                          effective_multixact_freeze_max_age,
+                                                         DEBUG3,
                                                          dovacuum, doanalyze, wraparound,
                                                          &scores);
 
@@ -3087,6 +3091,7 @@ relation_needs_vacanalyze(Oid relid,
                                                  Form_pg_class classForm,
                                                  PgStat_StatTabEntry *tabentry,
                                                  int effective_multixact_freeze_max_age,
+                                                 int elevel,
  /* output params below */
                                                  bool *dovacuum,
                                                  bool *doanalyze,
@@ -3336,14 +3341,14 @@ relation_needs_vacanalyze(Oid relid,
        }
 
        if (vac_ins_base_thresh >= 0)
-               elog(DEBUG3, "%s: vac: %.0f (thresh %.0f, score %.2f), ins: %.0f (thresh %.0f, score %.2f), anl: %.0f (thresh %.0f, score %.2f), xid score: %.2f, mxid score: %.2f",
+               elog(elevel, "%s: vac: %.0f (thresh %.0f, score %.2f), ins: %.0f (thresh %.0f, score %.2f), anl: %.0f (thresh %.0f, score %.2f), xid score: %.2f, mxid score: %.2f",
                         NameStr(classForm->relname),
                         vactuples, vacthresh, scores->vac,
                         instuples, vacinsthresh, scores->vac_ins,
                         anltuples, anlthresh, scores->anl,
                         scores->xid, scores->mxid);
        else
-               elog(DEBUG3, "%s: vac: %.0f (thresh %.0f, score %.2f), ins: (disabled), anl: %.0f (thresh %.0f, score %.2f), xid score: %.2f, mxid score: %.2f",
+               elog(elevel, "%s: vac: %.0f (thresh %.0f, score %.2f), ins: (disabled), anl: %.0f (thresh %.0f, score %.2f), xid score: %.2f, mxid score: %.2f",
                         NameStr(classForm->relname),
                         vactuples, vacthresh, scores->vac,
                         anltuples, anlthresh, scores->anl,