Document new 9.0 behavior of ANALYZE on inheritance hierarchies.
authorRobert Haas
Tue, 15 Jun 2010 18:43:35 +0000 (18:43 +0000)
committerRobert Haas
Tue, 15 Jun 2010 18:43:35 +0000 (18:43 +0000)
In particular, note that autovacuum does not yet understand that it might
need to vacuum inheritance parents as a result of changes to the child
tables.

doc/src/sgml/ref/analyze.sgml

index 1f2e4c1bad7286e1bcd67216833ab99a511f7b72..98dcbf0ed80af7369243495d6bea66ac4a34d9d7 100644 (file)
@@ -1,5 +1,5 @@
 
 
@@ -176,6 +176,17 @@ ANALYZE [ VERBOSE ] [ table [ ( 
    ALTER TABLE ... ALTER COLUMN ... SET (n_distinct = ...)
    (see ).
   
+
+  
+    If the table being analyzed has one or more children,
+    ANALYZE will gather statistics twice: once on the
+    rows of the parent table only, and a second time on the rows of the
+    parent table with all of its children.  The autovacuum daemon, however,
+    will only consider inserts or updates on the parent table when deciding
+    whether to trigger an automatic analyze.  If that table is rarely
+    inserted into or updated, the inheritance statistics will not be up to date
+    unless you run ANALYZE manually.
+