1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-19 13:42:17 +03:00

doc: clarify that pg_upgrade preserves "optimizer" stats.

Reported-by: Rambabu V

Author: Robert Treat

Discussion: https://postgr.es/m/CADtiZxrUzRRX6edyN2y-7U5HA8KSXttee7K=EFTLXjwG1SCE4A@mail.gmail.com

Backpatch-through: 18
This commit is contained in:
Bruce Momjian
2025-11-17 18:55:41 -05:00
parent a6eac2273e
commit 792353f7d5
2 changed files with 14 additions and 12 deletions

View File

@@ -1393,7 +1393,7 @@ PostgreSQL documentation
<term><option>--statistics</option></term> <term><option>--statistics</option></term>
<listitem> <listitem>
<para> <para>
Dump statistics. Dump optimizer statistics.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@@ -1403,7 +1403,7 @@ PostgreSQL documentation
<listitem> <listitem>
<para> <para>
Dump only the statistics, not the schema (data definitions) or data. Dump only the statistics, not the schema (data definitions) or data.
Statistics for tables, materialized views, foreign tables, Optimizer statistics for tables, materialized views, foreign tables,
and indexes are dumped. and indexes are dumped.
</para> </para>
</listitem> </listitem>
@@ -1699,11 +1699,12 @@ CREATE DATABASE foo WITH TEMPLATE template0;
</para> </para>
<para> <para>
If <option>--statistics</option> is specified, When <option>--statistics</option> is specified,
<command>pg_dump</command> will include most optimizer statistics in the <command>pg_dump</command> will include most optimizer statistics in the
resulting dump file. However, some statistics may not be included, such as resulting dump file. This does not include all statistics, such as
those created explicitly with <xref linkend="sql-createstatistics"/> or those created explicitly with <xref linkend="sql-createstatistics"/>,
custom statistics added by an extension. Therefore, it may be useful to custom statistics added by an extension, or statistics collected by the
cumulative statistics system. Therefore, it may still be useful to
run <command>ANALYZE</command> after restoring from a dump file to ensure run <command>ANALYZE</command> after restoring from a dump file to ensure
optimal performance; see <xref linkend="vacuum-for-statistics"/> and <xref optimal performance; see <xref linkend="vacuum-for-statistics"/> and <xref
linkend="autovacuum"/> for more information. linkend="autovacuum"/> for more information.

View File

@@ -639,7 +639,7 @@ exclude database <replaceable class="parameter">PATTERN</replaceable>
<term><option>--statistics</option></term> <term><option>--statistics</option></term>
<listitem> <listitem>
<para> <para>
Dump statistics. Dump optimizer statistics.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@@ -649,7 +649,7 @@ exclude database <replaceable class="parameter">PATTERN</replaceable>
<listitem> <listitem>
<para> <para>
Dump only the statistics, not the schema (data definitions) or data. Dump only the statistics, not the schema (data definitions) or data.
Statistics for tables, materialized views, foreign tables, Optimizer statistics for tables, materialized views, foreign tables,
and indexes are dumped. and indexes are dumped.
</para> </para>
</listitem> </listitem>
@@ -890,11 +890,12 @@ exclude database <replaceable class="parameter">PATTERN</replaceable>
</para> </para>
<para> <para>
If <option>--statistics</option> is specified, When <option>--statistics</option> is specified,
<command>pg_dumpall</command> will include most optimizer statistics in the <command>pg_dumpall</command> will include most optimizer statistics in the
resulting dump file. However, some statistics may not be included, such as resulting dump file. This does not include all statistics, such as
those created explicitly with <xref linkend="sql-createstatistics"/> or those created explicitly with <xref linkend="sql-createstatistics"/>,
custom statistics added by an extension. Therefore, it may be useful to custom statistics added by an extension, or statistics collected by the
cumulative statistics system. Therefore, it may still be useful to
run <command>ANALYZE</command> on each database after restoring from a dump run <command>ANALYZE</command> on each database after restoring from a dump
file to ensure optimal performance. You can also run <command>vacuumdb -a file to ensure optimal performance. You can also run <command>vacuumdb -a
-z</command> to analyze all databases. -z</command> to analyze all databases.