From 2a997a7065cbe25299006ca6ed6156516a56466f Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Sun, 7 Oct 2007 01:16:42 +0000 Subject: [PATCH] A few improvements to analyze and vacuum sections in documentation: add "see also" entries for autovacuum in analyze and vacuum reference pages, and enhance usage of cross-references in the maintenance page. --- doc/src/sgml/maintenance.sgml | 24 ++++++++++++++---------- doc/src/sgml/ref/analyze.sgml | 22 +++++++++++++++++++--- doc/src/sgml/ref/vacuum.sgml | 3 ++- 3 files changed, 35 insertions(+), 14 deletions(-) diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml index a7b740af1a..33b86818ca 100644 --- a/doc/src/sgml/maintenance.sgml +++ b/doc/src/sgml/maintenance.sgml @@ -1,4 +1,4 @@ - + Routine Database Maintenance Tasks @@ -59,9 +59,9 @@ - PostgreSQL's VACUUM () command has to run on a regular basis for several - reasons: + PostgreSQL's + command has to run on + a regular basis for several reasons: @@ -96,7 +96,8 @@ - Fortunately, autovacuum () monitors table + Fortunately, + monitors table activity and performs VACUUMs when necessary. Autovacuum works dynamically so it is often better administration-scheduled vacuuming. @@ -150,7 +151,8 @@ - Fortunately, autovacuum () monitors table + Fortunately, + monitors table activity and performs VACUUMs when necessary. This eliminates the need for administrators to worry about disk space recovery in all but the most unusual cases. @@ -218,7 +220,8 @@ The PostgreSQL query planner relies on statistical information about the contents of tables in order to generate good plans for queries. These statistics are gathered by - the ANALYZE command, which can be invoked by itself or + the command, + which can be invoked by itself or as an optional step in VACUUM. It is important to have reasonably accurate statistics, otherwise poor choices of plans might degrade database performance. @@ -262,7 +265,8 @@ - Fortunately, autovacuum () monitors table + Fortunately, + monitors table activity and performs ANALYZEs when necessary. This eliminates the need for administrators to manually schedule ANALYZE. @@ -341,8 +345,8 @@ when it was last vacuumed. If it were to go unvacuumed for longer than that, data loss could result. To ensure that this does not - happen, the autovacuum facility described in - is invoked on any table + happen, + is invoked on any table that might contain XIDs older than the age specified by the configuration parameter . (This will happen diff --git a/doc/src/sgml/ref/analyze.sgml b/doc/src/sgml/ref/analyze.sgml index bb293af03c..f84999b03f 100644 --- a/doc/src/sgml/ref/analyze.sgml +++ b/doc/src/sgml/ref/analyze.sgml @@ -1,5 +1,5 @@ @@ -92,7 +92,12 @@ ANALYZE [ VERBOSE ] [ table [ ( Notes - It is a good idea to run ANALYZE periodically, or + In the default PostgreSQL configuration, + + takes care of automatic analyzing of tables when they are first loaded + with data, and as they change throughout regular operation. + When autovacuum is disabled, + it is a good idea to run ANALYZE periodically, or just after making major changes in the contents of a table. Accurate statistics will help the planner to choose the most appropriate query plan, and thereby improve the speed of query processing. A common @@ -101,7 +106,7 @@ ANALYZE [ VERBOSE ] [ table [ ( - Unlike VACUUM FULL, ANALYZE + ANALYZE requires only a read lock on the target table, so it can run in parallel with other activity on the table. @@ -168,4 +173,15 @@ ANALYZE [ VERBOSE ] [ table [ ( ANALYZE statement in the SQL standard. + + + See Also + + + + + + + + diff --git a/doc/src/sgml/ref/vacuum.sgml b/doc/src/sgml/ref/vacuum.sgml index 60bd2ff73e..013b75f092 100644 --- a/doc/src/sgml/ref/vacuum.sgml +++ b/doc/src/sgml/ref/vacuum.sgml @@ -1,5 +1,5 @@ @@ -242,6 +242,7 @@ VACUUM +