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

2021-10-18 Thread Michael Paquier
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

Re: vacuumdb --analyze-in-stages

2021-10-18 Thread Euler Taveira
On Mon, Oct 18, 2021, at 8:53 PM, Alvaro Herrera wrote: > On 2021-Oct-18, David G. Johnston wrote: > > > On Mon, Oct 18, 2021 at 4:02 PM Alvaro Herrera > > wrote: > > > > Given that the first stage uses statistic target=1, running this option > > > in a database with any stats at all is

Re: vacuumdb --analyze-in-stages

2021-10-18 Thread Alvaro Herrera
On 2021-Oct-18, David G. Johnston wrote: > On Mon, Oct 18, 2021 at 4:02 PM Alvaro Herrera > wrote: > > Given that the first stage uses statistic target=1, running this option > > in a database with any stats at all is probably a bad idea. > > Add the word "only"? > > This option is only useful

Re: vacuumdb --analyze-in-stages

2021-10-18 Thread David G. Johnston
On Mon, Oct 18, 2021 at 4:02 PM Alvaro Herrera wrote: > On 2021-Oct-18, Euler Taveira wrote: > > > On Fri, Oct 8, 2021, at 6:33 AM, nikolai.berkoff wrote: > > > Running --analyze-in-stages on a database with statistics causes the > > > statistics to become significantly worse before they are

Re: vacuumdb --analyze-in-stages

2021-10-18 Thread Alvaro Herrera
On 2021-Oct-18, Euler Taveira wrote: > On Fri, Oct 8, 2021, at 6:33 AM, nikolai.berkoff wrote: > > Running --analyze-in-stages on a database with statistics causes the > > statistics to become significantly worse before they are improved. > > This could be made clearer in the documentation. > > I

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

2021-10-18 Thread Euler Taveira
On Fri, Oct 8, 2021, at 6:03 AM, nikolai.berkoff wrote: > The current documentation does not mention that the column statistics are > removed which I can see they are in src/backend/commands/tablecmds.c > > ATExecAlterColumnType > /* > * Drop any pg_statistic entry for the column, since it's now

Re: vacuumdb --analyze-in-stages

2021-10-18 Thread Euler Taveira
On Fri, Oct 8, 2021, at 6:33 AM, nikolai.berkoff wrote: > Running --analyze-in-stages on a database with statistics causes the > statistics to become significantly worse before they are improved. This > could be made clearer in the documentation. I think the paragraph you modified *already*