Re: Partitioned table statistics vs autoanalyze

2021-07-22 Thread Kamil Frydel
In v14 (which is currently in beta), autoanalyze will process the partitioned table automatically: https://www.postgresql.org/docs/14/release-14.html |Autovacuum now analyzes partitioned tables (Yuzuko Hosoya, Álvaro Herrera) |Insert, update, and delete tuple counts from partitions are now propaga

Re: Partitioned table statistics vs autoanalyze

2021-07-22 Thread Justin Pryzby
On Thu, Jul 22, 2021 at 01:32:51PM +0200, Kamil Frydel wrote: > table_1 and table_2 are hash partitioned using volume_id column. Usually we > make analyze on partitions. We do not make analyze on the partitioned table > (parent). > However, if we run 'analyze' on the partitioned table then planner

Partitioned table statistics vs autoanalyze

2021-07-22 Thread Kamil Frydel
Hi, we faced a performance issue when joining 2 partitioned tables (declarative partitioning). The planner chooses nested loop while we expect hash join. The query and the plan are available here: https://explain.depesz.com/s/23r9 table_1 and table_2 are hash partitioned using volume_id colu