From d5f1b6a75ba3f55a78959c957c3fd25d9569057c Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Wed, 30 Apr 2025 14:12:59 -0500 Subject: Further adjust guidance for running vacuumdb after pg_upgrade. Since pg_upgrade does not transfer the cumulative statistics used to trigger autovacuum and autoanalyze, the server may take much longer than expected to process them post-upgrade. Currently, we recommend analyzing only relations for which optimizer statistics were not transferred by using the --analyze-in-stages and --missing-stats-only options. This commit appends another recommendation to analyze all relations to update the relevant cumulative statistics by using the --analyze-only option. This is similar to the recommendation for pg_stat_reset(). Reported-by: Christoph Berg Reviewed-by: Christoph Berg Discussion: https://postgr.es/m/aAfxfKC82B9NvJDj%40msg.df7cb.de --- src/bin/pg_upgrade/check.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/bin/pg_upgrade/check.c b/src/bin/pg_upgrade/check.c index 18c2d652bb6..940fc77fc2e 100644 --- a/src/bin/pg_upgrade/check.c +++ b/src/bin/pg_upgrade/check.c @@ -814,9 +814,12 @@ output_completion_banner(char *deletion_script_file_name) } pg_log(PG_REPORT, - "Some optimizer statistics may not have been transferred by pg_upgrade.\n" - "Once you start the new server, consider running:\n" - " %s/vacuumdb %s--all --analyze-in-stages --missing-stats-only", new_cluster.bindir, user_specification.data); + "Some statistics are not transferred by pg_upgrade.\n" + "Once you start the new server, consider running these two commands:\n" + " %s/vacuumdb %s--all --analyze-in-stages --missing-stats-only\n" + " %s/vacuumdb %s--all --analyze-only", + new_cluster.bindir, user_specification.data, + new_cluster.bindir, user_specification.data); if (deletion_script_file_name) pg_log(PG_REPORT, -- cgit v1.2.3