Re: ALTER TABLE ... SET DATA TYPE removes statistics

From: "Euler Taveira" <euler(at)eulerto(dot)com>
To: "Alvaro Herrera" <alvherre(at)alvh(dot)no-ip(dot)org>, "Michael Paquier" <michael(at)paquier(dot)xyz>
Cc: "nikolai(dot)berkoff" <nikolai(dot)berkoff(at)pm(dot)me>, "pgsql-docs(at)lists(dot)postgresql(dot)org" <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: ALTER TABLE ... SET DATA TYPE removes statistics
Date: 2021-10-22 15:20:55
Message-ID: 6befff68-6293-4d75-9c66-72fe5596aa02@www.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

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/

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Kevin Sweet 2021-10-22 18:55:33 Re: documentation describing the range of a number type 'integer' is incorrect
Previous Message Alvaro Herrera 2021-10-22 13:43:30 Re: documentation describing the range of a number type 'integer' is incorrect