mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
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-stats-only option to only analyze relations that are missing statistics. Reviewed-by: John Naylor <johncnaylorls@gmail.com> Discussion: https://postgr.es/m/Z5O1bpcwDrMgyrYy%40nathan
This commit is contained in:
@ -807,10 +807,11 @@ psql --username=postgres --file=script.sql postgres
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Using <command>vacuumdb --all --analyze-only</command> can efficiently
|
Using <command>vacuumdb --all --analyze-only --missing-stats-only</command>
|
||||||
generate such statistics, and the use of <option>--jobs</option>
|
can efficiently generate such statistics. Alternatively,
|
||||||
can speed it up. Option <option>--analyze-in-stages</option>
|
<command>vacuumdb --all --analyze-in-stages --missing-stats-only</command>
|
||||||
can be used to generate minimal statistics quickly.
|
can be used to generate minimal statistics quickly. For either command,
|
||||||
|
the use of <option>--jobs</option> can speed it up.
|
||||||
If <varname>vacuum_cost_delay</varname> is set to a non-zero
|
If <varname>vacuum_cost_delay</varname> is set to a non-zero
|
||||||
value, this can be overridden to speed up statistics generation
|
value, this can be overridden to speed up statistics generation
|
||||||
using <envar>PGOPTIONS</envar>, e.g., <literal>PGOPTIONS='-c
|
using <envar>PGOPTIONS</envar>, e.g., <literal>PGOPTIONS='-c
|
||||||
|
@ -781,7 +781,7 @@ output_completion_banner(char *deletion_script_file_name)
|
|||||||
pg_log(PG_REPORT,
|
pg_log(PG_REPORT,
|
||||||
"Some optimizer statistics may not have been transferred by pg_upgrade.\n"
|
"Some optimizer statistics may not have been transferred by pg_upgrade.\n"
|
||||||
"Once you start the new server, consider running:\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-stats-only", new_cluster.bindir, user_specification.data);
|
||||||
|
|
||||||
if (deletion_script_file_name)
|
if (deletion_script_file_name)
|
||||||
pg_log(PG_REPORT,
|
pg_log(PG_REPORT,
|
||||||
|
Reference in New Issue
Block a user