Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd5f1b6a

Browse files
Further adjust guidance for running vacuumdb after pg_upgrade.
Since pg_upgrade does not transfer the cumulative statistics usedto trigger autovacuum and autoanalyze, the server may take muchlonger than expected to process them post-upgrade. Currently, werecommend analyzing only relations for which optimizer statisticswere not transferred by using the --analyze-in-stages and--missing-stats-only options. This commit appends anotherrecommendation to analyze all relations to update the relevantcumulative statistics by using the --analyze-only option. This issimilar to the recommendation for pg_stat_reset().Reported-by: Christoph Berg <myon@debian.org>Reviewed-by: Christoph Berg <myon@debian.org>Discussion:https://postgr.es/m/aAfxfKC82B9NvJDj%40msg.df7cb.de
1 parentf60420c commitd5f1b6a

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

‎doc/src/sgml/ref/pgupgrade.sgml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -833,17 +833,19 @@ psql --username=postgres --file=script.sql postgres
833833

834834
<para>
835835
Because not all statistics are not transferred by
836-
<command>pg_upgrade</command>, you will be instructed to runa command to
836+
<command>pg_upgrade</command>, you will be instructed to runcommands to
837837
regenerate that information at the end of the upgrade. You might need to
838838
set connection parameters to match your new cluster.
839839
</para>
840840

841841
<para>
842-
Using <command>vacuumdb --all --analyze-only --missing-stats-only</command>
843-
can efficiently generate such statistics. Alternatively,
842+
First, use
844843
<command>vacuumdb --all --analyze-in-stages --missing-stats-only</command>
845-
can be used to generate minimal statistics quickly. For either command,
846-
the use of <option>--jobs</option> can speed it up.
844+
to quickly generate minimal optimizer statistics for relations without
845+
any. Then, use <command>vacuumdb --all --analyze-only</command> to ensure
846+
all relations have updated cumulative statistics for triggering vacuum and
847+
analyze. For both commands, the use of <option>--jobs</option> can speed
848+
it up.
847849
If <varname>vacuum_cost_delay</varname> is set to a non-zero
848850
value, this can be overridden to speed up statistics generation
849851
using <envar>PGOPTIONS</envar>, e.g., <literal>PGOPTIONS='-c

‎src/bin/pg_upgrade/check.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -814,9 +814,12 @@ output_completion_banner(char *deletion_script_file_name)
814814
}
815815

816816
pg_log(PG_REPORT,
817-
"Some optimizer statistics may not have been transferred by pg_upgrade.\n"
818-
"Once you start the new server, consider running:\n"
819-
" %s/vacuumdb %s--all --analyze-in-stages --missing-stats-only",new_cluster.bindir,user_specification.data);
817+
"Some statistics are not transferred by pg_upgrade.\n"
818+
"Once you start the new server, consider running these two commands:\n"
819+
" %s/vacuumdb %s--all --analyze-in-stages --missing-stats-only\n"
820+
" %s/vacuumdb %s--all --analyze-only",
821+
new_cluster.bindir,user_specification.data,
822+
new_cluster.bindir,user_specification.data);
820823

821824
if (deletion_script_file_name)
822825
pg_log(PG_REPORT,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp