Re: pgsql: autovacuum: handle analyze for partitioned tables

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
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, Yuzuko <yuzukohosoya(at)gmail(dot)com>
Subject: Re: pgsql: autovacuum: handle analyze for partitioned tables
Date: 2021-04-09 22:16:59
Message-ID: 20210409221659.GA28298@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 2021-Apr-09, Justin Pryzby wrote:

> One data point: we do DETACH/ATTACH tables during normal operation, before
> type-promoting ALTERs, to avoid worst-case disk use, and to avoid locking the
> table for a long time. It'd be undesirable (but maybe of no great consequence)
> to trigger an ALTER when we DETACH them, since we'll re-ATTACH it shortly
> afterwards.

You mean to trigger an ANALYZE, not to trigger an ALTER, right?

I think I agree with Tomas: we should do it by default, and offer some
way to turn that off. I suppose a new reloptions, solely for
partitioned tables, would be the way to do it.

> However, I think DROP should be handled ?

DROP of a partition? ... I would think it should do the same as DETACH,
right? Inform that however many rows the partition had, are now changed
in ancestors.

--
Álvaro Herrera 39°49'30"S 73°17'W
"Aprender sin pensar es inútil; pensar sin aprender, peligroso" (Confucio)

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Justin Pryzby 2021-04-09 22:29:58 Re: pgsql: autovacuum: handle analyze for partitioned tables
Previous Message Tomas Vondra 2021-04-09 21:53:08 Re: pgsql: autovacuum: handle analyze for partitioned tables

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2021-04-09 22:29:58 Re: pgsql: autovacuum: handle analyze for partitioned tables
Previous Message Tomas Vondra 2021-04-09 21:53:08 Re: pgsql: autovacuum: handle analyze for partitioned tables