From 5209f228f09e52780535edacfee5f7efd2c25081 Mon Sep 17 00:00:00 2001 From: Laurenz Albe Date: Wed, 5 Oct 2022 10:31:47 +0200 Subject: [PATCH] Improve autovacuum doc on partitioned tables The documentation mentioned that autovacuum doesn't process partitioned tables, but it was unclear about the impact. The old wording could be interpreted to mean that there are problems with dead tuple cleanup on partitioned tables. Clarify that the only potential problem is autoanalyze, and that statistics for the partitions will be gathered. --- 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 759ea5ac9c..53e3fadbaf 100644 --- a/doc/src/sgml/maintenance.sgml +++ b/doc/src/sgml/maintenance.sgml @@ -860,10 +860,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 are not processed by autovacuum. This is no problem + as far as VACUUM is concerned, since autovacuum will process + the partitions. But, as mentioned in , + it also means that autovacuum won't run ANALYZE on the + partitioned table itself. While statistics are gathered for the partitions, + some queries may rely on the statistics for the partitioned table. You should + collect statistics by running a manual ANALYZE when the + partitioned table is first populated, and again whenever the distribution + of data in its partitions changes significantly. -- 2.37.3