Re: Autovacuum on partitioned table (autoanalyze)

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>, yuzuko <yuzukohosoya@gmail.com>, Tomas Vondra <tomas.vondra@enterprisedb.com>, David Steele <david@pgmasters.net>, Kyotaro Horiguchi <horikyota.ntt@gmail.com>, Justin Pryzby <pryzby@telsasoft.com>, Daniel Gustafsson <daniel@yesql.se>, Amit Langote <amitlangote09@gmail.com>, Masahiko Sawada <masahiko.sawada@2ndquadrant.com>, Laurenz Albe <laurenz.albe@cybertec.at>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Greg Stark <stark@mit.edu>
Date: 2021-08-09T22:25:49Z
Lists: pgsql-hackers
Hi,

On 2021-08-09 16:02:33 -0400, Alvaro Herrera wrote:
> On 2021-Jul-27, Andres Freund wrote:
> 
> > Isn't this going to create a *lot* of redundant sampling?  Especially if you
> > have any sort of nested partition tree. In the most absurd case a partition
> > with n parents will get sampled n times, solely due to changes to itself.
> 
> It seems to me that you're barking up the wrong tree on this point.
> This problem you describe is not something that was caused by this
> patch; ANALYZE has always worked like this.  We have discussed the idea
> of avoiding redundant sampling, but it's clear that it is not a simple
> problem, and solving it was not in scope for this patch.

I don't agree. There's a difference between this happening after a manual
ANALYZE on partition roots, and this continuously happening in production
workloads due to auto-analyzes...

Greetings,

Andres Freund



Commits

  1. Keep stats up to date for partitioned tables

  2. Revert analyze support for partitioned tables

  3. Document ANALYZE storage parameters for partitioned tables

  4. autovacuum: handle analyze for partitioned tables