aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2023-10-10 15:14:18 -0400
committerBruce Momjian <bruce@momjian.us>2023-10-10 15:14:18 -0400
commit4d966cc163f2cd1645eabdb95905320605b65f4e (patch)
tree1ce17b6d80f44794eadf7b74ef8ba4dd97cbcc02
parent6615bb95af2dece3142c1895bac1044e456de377 (diff)
downloadpostgresql-4d966cc163f2cd1645eabdb95905320605b65f4e.tar.gz
postgresql-4d966cc163f2cd1645eabdb95905320605b65f4e.zip
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
-rw-r--r--doc/src/sgml/maintenance.sgml13
1 files changed, 9 insertions, 4 deletions
diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml
index eaffb5a6592..0b5860ebbbd 100644
--- a/doc/src/sgml/maintenance.sgml
+++ b/doc/src/sgml/maintenance.sgml
@@ -841,10 +841,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>