Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 05f4365

Browse files
committed
Document that autovacuum may run ANALYZE
1 parent 7798147 commit 05f4365

File tree

6 files changed

+27
-16
lines changed

6 files changed

+27
-16
lines changed

doc/src/sgml/backup.sgml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/backup.sgml,v 2.129 2009/06/26 22:06:11 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/backup.sgml,v 2.130 2009/08/07 20:54:31 alvherre Exp $ -->
22

33
<chapter id="backup">
44
<title>Backup and Restore</title>
@@ -168,10 +168,10 @@ pg_dump -h <replaceable>host1</> <replaceable>dbname</> | psql -h <replaceable>h
168168
<para>
169169
After restoring a backup, it is wise to run <xref
170170
linkend="sql-analyze" endterm="sql-analyze-title"> on each
171-
database so the query optimizer has useful statistics. An easy way
172-
to do this is to run <command>vacuumdb -a -z</>; this is
173-
equivalent to running <command>VACUUM ANALYZE</> on each database
174-
manually. For more advice on how to load large amounts of data
171+
database so the query optimizer has useful statistics;
172+
see <xref linkend="vacuum-for-statistics" endterm="vacuum-for-statistics-title">
173+
and <xref linkend="autovacuum" endterm="autovacuum-title"> for more information.
174+
For more advice on how to load large amounts of data
175175
into <productname>PostgreSQL</> efficiently, refer to <xref
176176
linkend="populate">.
177177
</para>

doc/src/sgml/indices.sgml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/indices.sgml,v 1.78 2009/06/17 21:58:49 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/indices.sgml,v 1.79 2009/08/07 20:54:31 alvherre Exp $ -->
22

33
<chapter id="indexes">
44
<title id="indexes-title">Indexes</title>
@@ -1025,7 +1025,9 @@ SELECT am.amname AS index_method,
10251025
real statistics, some default values are assumed, which are
10261026
almost certain to be inaccurate. Examining an application's
10271027
index usage without having run <command>ANALYZE</command> is
1028-
therefore a lost cause.
1028+
therefore a lost cause.
1029+
See <xref linkend="vacuum-for-statistics" endterm="vacuum-for-statistics-title">
1030+
and <xref linkend="autovacuum" endterm="autovacuum-title"> for more information.
10291031
</para>
10301032
</listitem>
10311033

doc/src/sgml/maintenance.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/maintenance.sgml,v 1.95 2009/06/17 13:59:28 petere Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/maintenance.sgml,v 1.96 2009/08/07 20:54:31 alvherre Exp $ -->
22

33
<chapter id="maintenance">
44
<title>Routine Database Maintenance Tasks</title>
@@ -253,7 +253,7 @@
253253
</sect2>
254254

255255
<sect2 id="vacuum-for-statistics">
256-
<title>Updating Planner Statistics</title>
256+
<title id="vacuum-for-statistics-title">Updating Planner Statistics</title>
257257

258258
<indexterm zone="vacuum-for-statistics">
259259
<primary>statistics</primary>

doc/src/sgml/perform.sgml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/perform.sgml,v 1.71 2009/06/17 21:58:49 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/perform.sgml,v 1.72 2009/08/07 20:54:31 alvherre Exp $ -->
22

33
<chapter id="performance-tips">
44
<title>Performance Tips</title>
@@ -974,7 +974,10 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse;
974974
table. With no statistics or obsolete statistics, the planner might
975975
make poor decisions during query planning, leading to poor
976976
performance on any tables with inaccurate or nonexistent
977-
statistics.
977+
statistics. Note that if the autovacuum daemon is enabled, it might
978+
run <command>ANALYZE</command> automatically; see
979+
<xref linkend="vacuum-for-statistics" endterm="vacuum-for-statistics-title">
980+
and <xref linkend="autovacuum" endterm="autovacuum-title"> for more information.
978981
</para>
979982
</sect2>
980983

@@ -1054,7 +1057,9 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse;
10541057
while loading the data, but don't bother increasing
10551058
<varname>maintenance_work_mem</varname>; rather, you'd do that while
10561059
manually recreating indexes and foreign keys afterwards.
1057-
And don't forget to <command>ANALYZE</> when you're done.
1060+
And don't forget to <command>ANALYZE</> when you're done; see
1061+
<xref linkend="vacuum-for-statistics" endterm="vacuum-for-statistics-title">
1062+
and <xref linkend="autovacuum" endterm="autovacuum-title"> for more information.
10581063
</para>
10591064
</sect2>
10601065
</sect1>

doc/src/sgml/ref/pg_dump.sgml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/pg_dump.sgml,v 1.113 2009/03/22 16:44:26 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/pg_dump.sgml,v 1.114 2009/08/07 20:54:31 alvherre Exp $
33
PostgreSQL documentation
44
-->
55

@@ -834,7 +834,9 @@ CREATE DATABASE foo WITH TEMPLATE template0;
834834
does not contain the statistics used by the optimizer to make
835835
query planning decisions. Therefore, it is wise to run
836836
<command>ANALYZE</command> after restoring from a dump file
837-
to ensure good performance. The dump file also does not
837+
to ensure good performance; see <xref linkend="vacuum-for-statistics">
838+
and <xref linkend="autovacuum"> for more information.
839+
The dump file also does not
838840
contain any <command>ALTER DATABASE ... SET</> commands;
839841
these settings are dumped by <xref linkend="app-pg-dumpall">,
840842
along with database users and other installation-wide settings.

doc/src/sgml/ref/pg_restore.sgml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/ref/pg_restore.sgml,v 1.81 2009/03/20 09:21:08 petere Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/ref/pg_restore.sgml,v 1.82 2009/08/07 20:54:31 alvherre Exp $ -->
22

33
<refentry id="APP-PGRESTORE">
44
<refmeta>
@@ -679,7 +679,9 @@ CREATE DATABASE foo WITH TEMPLATE template0;
679679

680680
<para>
681681
Once restored, it is wise to run <command>ANALYZE</> on each
682-
restored table so the optimizer has useful statistics.
682+
restored table so the optimizer has useful statistics; see
683+
<xref linkend="vacuum-for-statistics"> and
684+
<xref linkend="autovacuum"> for more information.
683685
</para>
684686

685687
</refsect1>

0 commit comments

Comments
 (0)