mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	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
This commit is contained in:
		@@ -860,10 +860,15 @@ analyze threshold = analyze base threshold + analyze scale factor * number of tu
 | 
				
			|||||||
   </para>
 | 
					   </para>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   <para>
 | 
					   <para>
 | 
				
			||||||
    Partitioned tables are not processed by autovacuum.  Statistics
 | 
					    Partitioned tables do not directly store tuples and consequently
 | 
				
			||||||
    should be collected by running a manual <command>ANALYZE</command> when it is
 | 
					    are not processed by autovacuum.  (Autovacuum does process table
 | 
				
			||||||
    first populated, and again whenever the distribution of data in its
 | 
					    partitions just like other tables.)  Unfortunately, this means that
 | 
				
			||||||
    partitions changes significantly.
 | 
					    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>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   <para>
 | 
					   <para>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user