=== Applying patches on top of PostgreSQL commit ID 23792d7381583d04c4bbd0a8507566401ec013d3 === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Sat Nov 15 16:56:21 UTC 2025 On branch cf/6114 nothing to commit, working tree clean === using 'git am' to apply patch ./v8-0001-autovacuum-scheduling-improvements.patch === Applying: autovacuum scheduling improvements Using index info to reconstruct a base tree... M src/backend/postmaster/autovacuum.c M src/tools/pgindent/typedefs.list Falling back to patching base and 3-way merge... Auto-merging src/tools/pgindent/typedefs.list Auto-merging src/backend/postmaster/autovacuum.c CONFLICT (content): Merge conflict in src/backend/postmaster/autovacuum.c error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 autovacuum scheduling improvements When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". Unstaged changes after reset: M src/backend/postmaster/autovacuum.c M src/tools/pgindent/typedefs.list === using patch(1) to apply patch ./v8-0001-autovacuum-scheduling-improvements.patch === patching file src/backend/postmaster/autovacuum.c Hunk #18 FAILED at 3270. 1 out of 18 hunks FAILED -- saving rejects to file src/backend/postmaster/autovacuum.c.rej patching file src/tools/pgindent/typedefs.list Unstaged changes after reset: M src/backend/postmaster/autovacuum.c M src/tools/pgindent/typedefs.list Removing src/backend/postmaster/autovacuum.c.rej === using 'git apply' to apply patch ./v8-0001-autovacuum-scheduling-improvements.patch === Applied patch to 'src/backend/postmaster/autovacuum.c' with conflicts. Applied patch to 'src/tools/pgindent/typedefs.list' cleanly. U src/backend/postmaster/autovacuum.c diff --cc src/backend/postmaster/autovacuum.c index 1c38488f2cb,326055f962f..00000000000 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@@ -3158,34 -3265,49 +3265,52 @@@ relation_needs_vacanalyze(Oid relid vac_ins_scale_factor * reltuples * pcnt_unfrozen; anlthresh = (float4) anl_base_thresh + anl_scale_factor * reltuples; ++<<<<<<< ours ++======= + /* + * 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. + */ + + /* + * Determine if this table needs vacuum, and update the score if it + * does. + */ + if (vactuples > vacthresh) + { + *dovacuum = true; + *score = Max(*score, (double) vactuples / Max(vacthresh, 1)); + } + + if (vac_ins_base_thresh >= 0 && instuples > vacinsthresh) + { + *dovacuum = true; + *score = Max(*score, (double) instuples / Max(vacinsthresh, 1)); + } + + /* + * Determine if this table needs analyze, and update the score if it + * does. Note that we don't analyze TOAST tables and pg_statistic. + */ + if (anltuples > anlthresh && + relid != StatisticRelationId && + classForm->relkind != RELKIND_TOASTVALUE) + { + *doanalyze = true; + *score = Max(*score, (double) anltuples / Max(anlthresh, 1)); + } + ++>>>>>>> theirs if (vac_ins_base_thresh >= 0) - elog(DEBUG3, "%s: vac: %.0f (threshold %.0f), ins: %.0f (threshold %.0f), anl: %.0f (threshold %.0f)", + elog(DEBUG3, "%s: vac: %.0f (threshold %.0f), ins: %.0f (threshold %.0f), anl: %.0f (threshold %.0f), score: %.3f", NameStr(classForm->relname), - vactuples, vacthresh, instuples, vacinsthresh, anltuples, anlthresh); + vactuples, vacthresh, instuples, vacinsthresh, anltuples, anlthresh, *score); else - elog(DEBUG3, "%s: vac: %.0f (threshold %.0f), ins: (disabled), anl: %.0f (threshold %.0f)", + elog(DEBUG3, "%s: vac: %.0f (threshold %.0f), ins: (disabled), anl: %.0f (threshold %.0f), score %.3f", NameStr(classForm->relname), - vactuples, vacthresh, anltuples, anlthresh); - - /* Determine if this table needs vacuum or analyze. */ - *dovacuum = force_vacuum || (vactuples > vacthresh) || - (vac_ins_base_thresh >= 0 && instuples > vacinsthresh); - *doanalyze = (anltuples > anlthresh); - } - else - { - /* - * Skip a table not found in stat hash, unless we have to force vacuum - * for anti-wrap purposes. If it's not acted upon, there's no need to - * vacuum it. - */ - *dovacuum = force_vacuum; - *doanalyze = false; + vactuples, vacthresh, anltuples, anlthresh, *score); } - - /* ANALYZE refuses to work with pg_statistic */ - if (relid == StatisticRelationId) - *doanalyze = false; } /*