From b84664057699ac84e397c4237b54f91cd1bdd94e Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Tue, 11 Mar 2025 11:41:34 -0500 Subject: [PATCH v5 3/3] Update guidance for running vacuumdb after pg_upgrade. Now that pg_upgrade can carry over most optimizer statistics, we should recommend using vacuumdb's new --missing-only option to only analyze relations that are missing statistics. Discussion: https://postgr.es/m/Z5O1bpcwDrMgyrYy%40nathan --- doc/src/sgml/ref/pgupgrade.sgml | 2 +- src/bin/pg_upgrade/check.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/sgml/ref/pgupgrade.sgml b/doc/src/sgml/ref/pgupgrade.sgml index 9ef7a84eed0..4bc589010c1 100644 --- a/doc/src/sgml/ref/pgupgrade.sgml +++ b/doc/src/sgml/ref/pgupgrade.sgml @@ -807,7 +807,7 @@ psql --username=postgres --file=script.sql postgres - Using vacuumdb --all --analyze-only can efficiently + Using vacuumdb --all --analyze-only --missing-only can efficiently generate such statistics, and the use of can speed it up. Option can be used to generate minimal statistics quickly. diff --git a/src/bin/pg_upgrade/check.c b/src/bin/pg_upgrade/check.c index 88db8869b6e..2022f53f110 100644 --- a/src/bin/pg_upgrade/check.c +++ b/src/bin/pg_upgrade/check.c @@ -781,7 +781,7 @@ 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", new_cluster.bindir, user_specification.data); + " %s/vacuumdb %s--all --analyze-in-stages --missing-only", new_cluster.bindir, user_specification.data); if (deletion_script_file_name) pg_log(PG_REPORT, -- 2.39.5 (Apple Git-154)