Document that autovacuum may run ANALYZE
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 7 Aug 2009 20:54:31 +0000 (20:54 +0000)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 7 Aug 2009 20:54:31 +0000 (20:54 +0000)
doc/src/sgml/backup.sgml
doc/src/sgml/indices.sgml
doc/src/sgml/maintenance.sgml
doc/src/sgml/perform.sgml
doc/src/sgml/ref/pg_dump.sgml
doc/src/sgml/ref/pg_restore.sgml

index 372321ed1939a557337ec097099ec5c7a5b87d24..b633e046350e2200067b741b1049f885c38f89b3 100644 (file)
@@ -168,10 +168,10 @@ pg_dump -h <replaceable>host1</> <replaceable>dbname</> | psql -h <replaceable>h
    <para>
     After restoring a backup, it is wise to run <xref
     linkend="sql-analyze" endterm="sql-analyze-title"> on each
-    database so the query optimizer has useful statistics. An easy way
-    to do this is to run <command>vacuumdb -a -z</>; this is
-    equivalent to running <command>VACUUM ANALYZE</> on each database
-    manually.  For more advice on how to load large amounts of data
+    database so the query optimizer has useful statistics;
+    see <xref linkend="vacuum-for-statistics" endterm="vacuum-for-statistics-title">
+    and <xref linkend="autovacuum" endterm="autovacuum-title"> for more information.
+    For more advice on how to load large amounts of data
     into <productname>PostgreSQL</> efficiently, refer to <xref
     linkend="populate">.
    </para>
index 24674193fdf76c3bb594e0eded5bc5e8888ed9ca..8f24177225a84aa5db376f806554da2e1f8677f4 100644 (file)
@@ -1025,7 +1025,9 @@ SELECT am.amname AS index_method,
      real statistics, some default values are assumed, which are
      almost certain to be inaccurate.  Examining an application's
      index usage without having run <command>ANALYZE</command> is
-     therefore a lost cause.
+     therefore a lost cause. 
+     See <xref linkend="vacuum-for-statistics" endterm="vacuum-for-statistics-title">
+     and <xref linkend="autovacuum" endterm="autovacuum-title"> for more information.
     </para>
    </listitem>
 
index e9180a07c4eaa8fb40895947ea66f209850e4df1..df13d579cc7f30ebfd6228b67cf948a61c521652 100644 (file)
   </sect2>
 
   <sect2 id="vacuum-for-statistics">
-   <title>Updating Planner Statistics</title>
+   <title id="vacuum-for-statistics-title">Updating Planner Statistics</title>
 
    <indexterm zone="vacuum-for-statistics">
     <primary>statistics</primary>
index 49b86eb8b1d129cf0ab8f31ec7a447930eace411..e26251838c44664cdb9d19a4403489f2f922a12e 100644 (file)
@@ -974,7 +974,10 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse;
     table.  With no statistics or obsolete statistics, the planner might
     make poor decisions during query planning, leading to poor
     performance on any tables with inaccurate or nonexistent
-    statistics.
+    statistics.  Note that if the autovacuum daemon is enabled, it might
+    run <command>ANALYZE</command> automatically; see
+    <xref linkend="vacuum-for-statistics" endterm="vacuum-for-statistics-title">
+    and <xref linkend="autovacuum" endterm="autovacuum-title"> for more information.
    </para>
   </sect2>
 
@@ -1054,7 +1057,9 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse;
     while loading the data, but don't bother increasing
     <varname>maintenance_work_mem</varname>; rather, you'd do that while
     manually recreating indexes and foreign keys afterwards.
-    And don't forget to <command>ANALYZE</> when you're done.
+    And don't forget to <command>ANALYZE</> when you're done; see
+    <xref linkend="vacuum-for-statistics" endterm="vacuum-for-statistics-title">
+    and <xref linkend="autovacuum" endterm="autovacuum-title"> for more information.
    </para>
   </sect2>
   </sect1>
index 2b974c902f8c41ba4c4281abae5c7dde87d50b5d..6499a32172bd06c8195a0342c5c700521a0efa5e 100644 (file)
@@ -834,7 +834,9 @@ CREATE DATABASE foo WITH TEMPLATE template0;
    does not contain the statistics used by the optimizer to make
    query planning decisions.  Therefore, it is wise to run
    <command>ANALYZE</command> after restoring from a dump file
-   to ensure good performance.  The dump file also does not
+   to ensure good performance; see <xref linkend="vacuum-for-statistics">
+   and <xref linkend="autovacuum"> for more information.
+   The dump file also does not
    contain any <command>ALTER DATABASE ... SET</> commands;
    these settings are dumped by <xref linkend="app-pg-dumpall">,
    along with database users and other installation-wide settings.
index 35089e73e0c6dcd68994597d0ae07ce7cc41998b..7d3820c3aff87a1ce00fa7600f83b6c8eaae906c 100644 (file)
@@ -679,7 +679,9 @@ CREATE DATABASE foo WITH TEMPLATE template0;
 
   <para>
    Once restored, it is wise to run <command>ANALYZE</> on each
-   restored table so the optimizer has useful statistics.
+   restored table so the optimizer has useful statistics; see
+   <xref linkend="vacuum-for-statistics"> and
+   <xref linkend="autovacuum"> for more information.
   </para>
 
  </refsect1>