Skip to content

Commit 7454502

Browse files
committed
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
1 parent ef74c71 commit 7454502

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

doc/src/sgml/maintenance.sgml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -861,10 +861,15 @@ analyze threshold = analyze base threshold + analyze scale factor * number of tu
861861
</para>
862862

863863
<para>
864-
Partitioned tables are not processed by autovacuum. Statistics
865-
should be collected by running a manual <command>ANALYZE</command> when it is
866-
first populated, and again whenever the distribution of data in its
867-
partitions changes significantly.
864+
Partitioned tables do not directly store tuples and consequently
865+
are not processed by autovacuum. (Autovacuum does process table
866+
partitions just like other tables.) Unfortunately, this means that
867+
autovacuum does not run <command>ANALYZE</command> on partitioned
868+
tables, and this can cause suboptimal plans for queries that reference
869+
partitioned table statistics. You can work around this problem by
870+
manually running <command>ANALYZE</command> on partitioned tables
871+
when they are first populated, and again whenever the distribution
872+
of data in their partitions changes significantly.
868873
</para>
869874

870875
<para>

0 commit comments

Comments
 (0)