Re: pgsql: autovacuum: handle analyze for partitioned tables

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Zhihong Yu <zyu(at)yugabyte(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: autovacuum: handle analyze for partitioned tables
Date: 2021-04-22 17:43:46
Message-ID: 20210422174346.GE7256@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Wed, Apr 21, 2021 at 07:06:49PM -0400, Alvaro Herrera wrote:
> On 2021-Apr-09, Robert Haas wrote:
> > Does this need to worry about new partitions getting attached to a
> > partitioned table, or old ones getting detached? (Maybe it does
> > already, not sure.)
>
> I was pinged because this is listed as an open item. I don't think it
> is one. Handling ATTACH/DETACH/DROP is important for overall
> consistency, of course, so we should do it eventually, but the fact that
> autovacuum runs analyze *at all* for partitioned tables is an enormous
> step forward from it not doing so. I think we should treat ATTACH/
> DETACH/DROP handling as a further feature to be added in a future
> release, not an open item to be fixed in the current one.

I think this is okay, with the caveat that we'd be changing the behavior
(again) in a future release, rather than doing it all in v14.

Maybe the behavior should be documented, though. Actually, I thought the
pre-existing (non)behavior of autoanalyze would've been documented, and we'd
now update that. All I can find is this:

https://www.postgresql.org/docs/current/sql-analyze.html
|The autovacuum daemon, however, will only consider inserts or updates on the
|parent table itself when deciding whether to trigger an automatic analyze for
|that table

I think that should probably have been written down somewhere other than for
the manual ANALYZE command, but in any case it seems to be outdated now.

--
Justin

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2021-04-22 18:47:34 pgsql: Doc: document the tie-breaking behavior of the round() function.
Previous Message Tom Lane 2021-04-22 15:47:03 pgsql: Fix bugs in RETURNING in cross-partition UPDATE cases.

Browse pgsql-hackers by date

  From Date Subject
Next Message Andy Fan 2021-04-22 17:46:08 Re: Converting NOT IN to anti-joins during planning
Previous Message Justin Pryzby 2021-04-22 17:34:37 Re: TRUNCATE on foreign table