1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-19 17:02:53 +03:00

vacuumdb: Add option --analyze-in-stages

Add vacuumdb option --analyze-in-stages which runs ANALYZE three times
with different configuration settings, adopting the logic from the
analyze_new_cluster.sh script that pg_upgrade generates.  That way,
users of pg_dump/pg_restore can also use that functionality.

Change pg_upgrade to create the script so that it calls vacuumdb instead
of implementing the logic itself.
This commit is contained in:
Peter Eisentraut
2014-04-14 23:15:05 -04:00
parent 0d3b2b80aa
commit c92c3d50d7
4 changed files with 94 additions and 70 deletions

View File

@@ -203,6 +203,26 @@ PostgreSQL documentation
</listitem>
</varlistentry>
<varlistentry>
<term><option>--analyze-in-stages</option></term>
<listitem>
<para>
Only calculate statistics for use by the optimizer (no vacuum),
like <option>--analyze-only</option>. Run several (currently three)
stages of analyze with different configuration settings, to produce
usable statistics faster.
</para>
<para>
This option is useful to analyze a database that was newly populated
from a restored dump or by <command>pg_upgrade</command>. This option
will try to create some statistics as fast as possible, to make the
database usable, and then produce full statistics in the subsequent
stages.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-?</></term>
<term><option>--help</></term>