pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: Justin Pryzby <pryzby@telsasoft.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Zhihong Yu <zyu@yugabyte.com>
Cc: pgsql-hackers@lists.postgresql.org, Yuzuko <yuzukohosoya@gmail.com>
Subject: Re: pgsql: autovacuum: handle analyze for partitioned tables
Date: Fri, 9 Apr 2021 23:53:08 +0200
Message-ID: <ee587b50-757e-a2e4-15a9-5a74f5f92cd1@enterprisedb.com> (raw)
In-Reply-To: <20210409214508.GV6592@telsasoft.com>
References: <CA+TgmoaVOx7K0BE8xpR=_FwLGEP1kJoSx+oskCsVGmuJq5h4vw@mail.gmail.com>
	<20210409213155.GA23912@alvherre.pgsql>
	<20210409214508.GV6592@telsasoft.com>



On 4/9/21 11:45 PM, Justin Pryzby wrote:
> On Fri, Apr 09, 2021 at 05:31:55PM -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.)
>>
>> Good question.  It does not.
> 
> I think there's probably cases where this is desirable, and cases where it's
> undesirable, so I don't think it's necessarily a problem.
> 
> 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.
> 
> However, I think DROP should be handled ?
> 

IMHO we should prefer the default behavior which favors having updated
statistics, and maybe have a way to override it for individual commands.
So ATTACH would update changes_since_analyze by default, but it would be
possible to disable that.


regards

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company





view thread (33+ messages)  latest in thread

Message-ID: <ee587b50-757e-a2e4-15a9-5a74f5f92cd1@enterprisedb.com>
Permalink:  ../ee587b50-757e-a2e4-15a9-5a74f5f92cd1@enterprisedb.com/
Also on:    postgresql.org/message-id/ee587b50-757e-a2e4-15a9-5a74f5f92cd1@enterprisedb.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tomas.vondra@enterprisedb.com, pryzby@telsasoft.com, alvherre@alvh.no-ip.org, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, zyu@yugabyte.com, yuzukohosoya@gmail.com
  Subject: Re: pgsql: autovacuum: handle analyze for partitioned tables
  In-Reply-To: <ee587b50-757e-a2e4-15a9-5a74f5f92cd1@enterprisedb.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox