Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mdwMJ-0001Ov-Ty for pgsql-docs@arkaria.postgresql.org; Fri, 22 Oct 2021 15:21:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mdwMI-0003CN-Ph for pgsql-docs@arkaria.postgresql.org; Fri, 22 Oct 2021 15:21:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mdwMH-00037l-9W for pgsql-docs@lists.postgresql.org; Fri, 22 Oct 2021 15:21:26 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mdwMD-0000vK-0t for pgsql-docs@lists.postgresql.org; Fri, 22 Oct 2021 15:21:24 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 782A532009A1; Fri, 22 Oct 2021 11:21:17 -0400 (EDT) Received: from imap21 ([10.202.2.71]) by compute1.internal (MEProxy); Fri, 22 Oct 2021 11:21:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eulerto.com; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type; s=fm3; bh=gZI2tQ/pNaCqT07VFj8j1bP/QACCI5I R5igwLJHAPh8=; b=FZi1QmDGp/R9Ts2GvyHzDPepvoEBeNXYt7b2RCfkyWamW8a WqAKjhn/oXVsPj1Y6Q79N3PXPB9ta0am4+yAGyGH2vW286mPDYGXLzrmGBTr+nLI G4YfhPvAEMwC4zh6HK/puf6VpJmsdA9rmyDY1Iu8Y8KLCP8n/NPxnECSrbSrs2ee KApFYUkwt1bl2U+/I7bnPzaD1T0+MnHBj5useoAD+q81SZqhrcRiH+kZb4uFqLKD 9yxsnnrcwtPNzSTCaExyNEEgaXTK/EJtce/Z4D9H8BrOj+W0oKW6S1EH2QUKtAJe qNi1z3925YpfIMKPCKa+ArSpH3dwuazbaMJFvnw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=gZI2tQ /pNaCqT07VFj8j1bP/QACCI5IR5igwLJHAPh8=; b=ezYbDPwmwhmp27XT4K2Wz8 xzophXCNWlNXzDWxa2YTy2MNm5bdGwbKEt5zGwqiVc+QOxyhfHzETTofRzPPQNjZ eipx/eCTMKvxwFvEAf6RCwrJDMVu+oZx9y6hefFAjeAeCmH+K8EtdoBLGGIySnMP QJVQsA1btE7sLvIBckWh8tL4s3okxcm6upx9csRpH1r7ar5MAcqNXoYW6bS40hxp VWqSm6j/zgskz3/RvMBGcjzB1gpaXXuqvh0tdFcBuI9bZ/FR1983r90Q3Iwyebck B21ti595KpXNVfszNmyLuI1wznO8TpN3ZBlZ6g0/mQ3wCobxnL91hRnFe8QmLirg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddvkedgjedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesrgdtreerreertdenucfhrhhomhepfdfguhhl vghrucfvrghvvghirhgrfdcuoegvuhhlvghrsegvuhhlvghrthhordgtohhmqeenucggtf frrghtthgvrhhnpeejtefhuedvgffftdetvedufedtjeeuffekleevkefhveekgeelfefh jeehtdejgeenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepvghulhgvrhesvghu lhgvrhhtohdrtghomh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 3292151C0060; Fri, 22 Oct 2021 11:21:16 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-1369-gd055fb5e7c-fm-20211018.002-gd055fb5e Mime-Version: 1.0 Message-Id: <6befff68-6293-4d75-9c66-72fe5596aa02@www.fastmail.com> In-Reply-To: <202110191516.eufiqzha2etw@alvherre.pgsql> References: <202110191516.eufiqzha2etw@alvherre.pgsql> Date: Fri, 22 Oct 2021 12:20:55 -0300 From: "Euler Taveira" To: "Alvaro Herrera" , "Michael Paquier" Cc: "nikolai.berkoff" , "pgsql-docs@lists.postgresql.org" Subject: Re: ALTER TABLE ... SET DATA TYPE removes statistics Content-Type: multipart/alternative; boundary=e249a98169d14376880e2d0394468938 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --e249a98169d14376880e2d0394468938 Content-Type: text/plain On Tue, Oct 19, 2021, at 12:16 PM, Alvaro Herrera wrote: > On 2021-Oct-19, Michael Paquier wrote: > > > On Mon, Oct 18, 2021 at 05:15:59PM -0300, Euler Taveira wrote: > > > I agree that it might surprise an user and it would be good to document it. > > > However, it does not belong to the description. I would add it to the Notes > > > section at the end of the ALTER TABLE page. > > > > No objections to the suggested addition and the location of the > > addition (paragraph of SET DATA TYPE rather than "Notes"), but I think > > that the phrasing could be better: > > "The column's statistics are removed, hence a follow-up ANALYZE is > > suited to update the statistics to the new column type." > > Dunno, putting it in the middle of the existing paragraph looks odd to > me. I would put it in a separate one instead, as in the attached. LGTM. I'm not sure if it is worth mentioning that the user needs to ANALYZE only the removed column instead of the whole table. Anyway, it is good to have statistics from the same snapshot. -- Euler Taveira EDB https://www.enterprisedb.com/ --e249a98169d14376880e2d0394468938 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
On Tue, Oct 19,= 2021, at 12:16 PM, Alvaro Herrera wrote:
On 2021-Oct-19, Michael Paquier wrote:

> On Mon, Oct 18, 2021 at 05:15:59PM -0300= , Euler Taveira wrote:
> > I agree that it might sur= prise an user and it would be good to document it.
> &g= t; However, it does not belong to the description. I would add it to the= Notes
> > section at the end of the ALTER TABLE pag= e.
> 
> No objections to the sugg= ested addition and the location of the
> addition (para= graph of SET DATA TYPE rather than "Notes"), but I think
&= gt; that the phrasing could be better:
> "The column's = statistics are removed, hence a follow-up ANALYZE is
> = suited to update the statistics to the new column type."
<= br>
Dunno, putting it in the middle of the existing paragraph = looks odd to
me.  I would put it in a separate one in= stead, as in the attached.
LGTM. I'm not sure= if it is worth mentioning that the user needs to ANALYZE
= only the removed column instead of the whole table. Anyway, it is good t= o have
statistics from the same snapshot.

--
Euler Taveira

--e249a98169d14376880e2d0394468938--