public inbox for [email protected]
help / color / mirror / Atom feedFrom: Adrian Klaver <[email protected]>
To: Y_Bharani_mbsv <[email protected]>
To: Greg Sabino Mullane <[email protected]>
To: Ron Johnson <[email protected]>
Cc: pgsql-general <[email protected]>
Subject: Re: Help in vetting outcome of "vacuumdb --analyze-in-stages" - during DB Upgrade from EC2- PGS - Community Edn ver 13.X to 14.X
Date: Sun, 16 Feb 2025 08:19:35 -0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<CANzqJaC1Uk4H=55vV_jbFYMuD1f9Bb_4Y9WKvkZA3bt92bEUnw@mail.gmail.com>
<[email protected]>
<[email protected]>
<CAKAnmmKZdhnhdNRd3OgDyEco9OPkT=qA_TeWMFMRvUM9pXauKg@mail.gmail.com>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
On 2/16/25 05:13, Y_Bharani_mbsv wrote:
> Team
> Good Morning.
> As part of DB upgrade from EC2 - PGS - community Edn Ver 13.X to 14.X
> I followed steps of "pg_upgrade" and had executed the last step (post
> successful db migration)
>
> vacuumdb --analyze-in-stages
>
> and later noticed an caveat
> url = https://www.postgresql.org/docs/current/app-vacuumdb.html
> <https://www.postgresql.org/docs/current/app-vacuumdb.html;
>
>
> |--analyze-in-stages|
>
> Only calculate statistics for use by the optimizer (no vacuum), like
> |--analyze-only|. Run three stages of analyze; the first stage uses
> the lowest possible statistics target (see default_statistics_target
> <https://www.postgresql.org/docs/current/runtime-config-query.html#GUC-DEFAULT-STATISTICS-TARGET;) to produce usable statistics faster, and subsequent stages build the full statistics.
>
> This option is only useful to analyze a database that currently has
> no statistics or has wholly incorrect ones, such as if it is newly
> populated from a restored dump or by |pg_upgrade|. *Be aware that
> running with this option in a database with existing statistics may
> cause the query optimizer choices to become transiently worse due to
> the low statistics targets of the early stages.*
Did you skip over reading this part?:
"This option is only useful to analyze a database that currently has no
statistics or has wholly incorrect ones, such as if it is newly
populated from a restored dump or by pg_upgrade."
>
>
> How to overcome the issue to avoid "transiently worse"
>
>
>
> Later, I too did
> a) vacuum(full,verbose,skip_locked) ... each table wise
> b) analyze (verbose,skip_locked) .. each table wise
> Any guidance
>
--
Adrian Klaver
[email protected]
view thread (61+ messages) latest in thread
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: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: Help in vetting outcome of "vacuumdb --analyze-in-stages" - during DB Upgrade from EC2- PGS - Community Edn ver 13.X to 14.X
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox