Re: vacuumdb --analyze-in-stages

From: "nikolai(dot)berkoff" <nikolai(dot)berkoff(at)pm(dot)me>
To: Euler Taveira <euler(at)eulerto(dot)com>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "pgsql-docs(at)lists(dot)postgresql(dot)org" <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: vacuumdb --analyze-in-stages
Date: 2021-10-26 14:18:51
Message-ID: czz9wn0n6dToi_HrmuLZm2fnjXX6m4QzagoBWILNd-0gGZVNn5aOnlDCXsuxQw1RQXs1tyR2PS_ux3axoJkcxH4OY8Srcp9Fe4jHmqCzRHM=@pm.me
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday, October 19th, 2021 at 01:02, Euler Taveira <euler(at)eulerto(dot)com> wrote:

> 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 <alvherre(at)alvh(dot)no-ip(dot)org>
> > > 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 to analyze a database...
> >

> > Maybe this is sufficient, since it would drive people away from trying
> > to do anything else than help upgrades with it.
>

> +1. I like your 2nd suggestion.
>

> "This option is only useful to analyze a database that was newly populated from
> a restored dump or by <command>pg_upgrade</command>.  Beware that running with
> this option in a database with existing statistics may cause query optimizer
> choices to become transiently worse, because of the very low statistics target
> that is used in the early stages."
>

> > > "Run several (currently three) stages of analyze with different
> > > configuration settings, to produce usable statistics faster.  The first of
> > > these stages will remove any existing statistics even if they use a larger
> > > statistic target configuration."
> >

> > .. yeah, this is another option.
>

> We might include it too but I would suggest "replace" instead of "remove"
> because it seems there won't be statistics after the first stage.

Given all the suggestions I've tried to combine them into one patch again.

Regards,

Nikolai

Attachment Content-Type Size
analyze_in_stages.patch text/x-patch 1.6 KB

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message nikolai.berkoff 2021-10-26 14:24:01 Re: ALTER TABLE ... SET DATA TYPE removes statistics
Previous Message Thomas Munro 2021-10-26 00:19:29 Re: The huge_pages parameter doesn't work when shared_memory_type is sysv