postgres.git / summary / log / commit / refs
commit 7454502f94f6b8addff867f38aa5166eb82c79dc
Author: Bruce Momjian <bruce@momjian.us>
Date: Tue Oct 10 19:14:19 2023 +0000
First released in: 17.0, 11.22, 12.17, 13.13, 14.10, 15.5, 16.1
doc: document the need to analyze partitioned tables
Autovacuum does not do it.
Reported-by: Justin Pryzby
Discussion: https://postgr.es/m/20210913035409.GA10647@telsasoft.com
Backpatch-through: 11
doc/src/sgml/maintenance.sgml | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml
index 9cf9d030a8a..3018d8f64cf 100644
--- a/doc/src/sgml/maintenance.sgml
+++ b/doc/src/sgml/maintenance.sgml
@@ -861,10 +861,15 @@ analyze threshold = analyze base threshold + analyze scale factor * number of tu
</para>
<para>
- Partitioned tables are not processed by autovacuum. Statistics
- should be collected by running a manual <command>ANALYZE</command> 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 <command>ANALYZE</command> 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 <command>ANALYZE</command> on partitioned tables
+ when they are first populated, and again whenever the distribution
+ of data in their partitions changes significantly.
</para>
<para>
[parent: ef74c7197c04]