doc: document the need to analyze partitioned tables
authorBruce Momjian
Tue, 10 Oct 2023 19:14:18 +0000 (15:14 -0400)
committerBruce Momjian
Tue, 10 Oct 2023 19:14:18 +0000 (15:14 -0400)
Autovacuum does not do it.

Reported-by: Justin Pryzby
Discussion: https://postgr.es/m/20210913035409[email protected]

Backpatch-through: 11

doc/src/sgml/maintenance.sgml

index 9cf9d030a8a04074af9fc0f9097b108a0b21d9bc..3018d8f64cf33f2775529475c7136b05c178c82e 100644 (file)
@@ -861,10 +861,15 @@ analyze threshold = analyze base threshold + analyze scale factor * number of tu
    
 
    
-    Partitioned tables are not processed by autovacuum.  Statistics
-    should be collected by running a manual ANALYZE when it is
-    first populated, and again whenever the distribution of data in its
-    partitions changes significantly.
+    Partitioned tables do not directly store tuples and consequently
+    are not processed by autovacuum.  (Autovacuum does process table
+    partitions just like other tables.)  Unfortunately, this means that
+    autovacuum does  not run ANALYZE on partitioned
+    tables, and this can cause suboptimal plans for queries that reference
+    partitioned table statistics.  You can work around this problem by
+    manually running ANALYZE on partitioned tables
+    when they are first populated, and again whenever the distribution
+    of data in their partitions changes significantly.