pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Frédéric Yhuel <frederic.yhuel@dalibo.com>
Cc: Nathan Bossart <nathandbossart@gmail.com>
Cc: Corey Huinker <corey.huinker@gmail.com>
Cc: John Naylor <johncnaylorls@gmail.com>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Jeff Davis <pgsql@j-davis.com>
Cc: jian he <jian.universality@gmail.com>
Cc: Matthias van de Meent <boekewurm+postgres@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Magnus Hagander <magnus@hagander.net>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Cc: Peter Smith <smithpb2250@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: alvherre@alvh.no-ip.org
Subject: Re: vacuumdb changes for stats import/export
Date: Sat, 26 Jul 2025 10:22:49 -0400
Message-ID: <aITkuWC4Ww88GsFL@momjian.us> (raw)
In-Reply-To: <4b94ca16-7a6d-4581-b2aa-4ea79dbc082a@dalibo.com>
References: <CANWCAZa3tOfy2t7PraGh7td0nuO8rLesE8Cp2D1QZ+vM0hRcxg@mail.gmail.com>
	<Z88AgUXOR3e3ZsDV@nathan>
	<Z9BsEfqEmwkUetgz@nathan>
	<CANWCAZbiLHGeAZPYg6G6eT6MmCXM7CuYBEj3WhWw76e_HQejDA@mail.gmail.com>
	<Z9HhrtaZyFgMvJsM@nathan>
	<Z9R9-mFbxukqKmg4@nathan>
	<Z9jXuyymBSVDw9pv@nathan>
	<CADkLM=ek625v06WeeOpUNjGnCqyD8pH_0iYcCpg57KP3A8D9qg@mail.gmail.com>
	<Z9nnsPBlBzWxDuLi@nathan>
	<4b94ca16-7a6d-4581-b2aa-4ea79dbc082a@dalibo.com>

On Wed, Jul 23, 2025 at 02:45:10PM +0200, Frédéric Yhuel wrote:
> 
> 
> On 3/18/25 22:37, Nathan Bossart wrote:
> > Committed with the following small changes:
> 
> Hi, I don't really understand this sentence in
> doc/src/sgml/ref/vacuumdb.sgml:
> 
> > This option prevents vacuumdb from deleting existing statistics so that
> the query optimizer's choices do not become transiently worse.
> 
> I thought that the point was to avoid unnecessary post-upgrade analyzes?

So, the full paragraph is:

+        Only analyze relations that are missing statistics for a column, index
+        expression, or extended statistics object.  This option prevents
+        <application>vacuumdb</application> from deleting existing statistics
+        so that the query optimizer's choices do not become transiently worse.

What it is trying to say is that if you run vacuumedb without this
option, not only will it analyze all tables, including ones that already
have statistics, but will drop statistics on this tables that already
have statistics for a brief period while it installs new statistics. 
During that period, the optimizer will not have any statistics for the
table.  Is there a clearer way to state this?

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Do not let urgent matters crowd out time for investment in the future.





view thread (36+ messages)  latest in thread

Message-ID: <aITkuWC4Ww88GsFL@momjian.us>
Permalink:  ../aITkuWC4Ww88GsFL@momjian.us/
Also on:    postgresql.org/message-id/aITkuWC4Ww88GsFL@momjian.us

 · 

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: pgsql-hackers@postgresql.org
  Cc: bruce@momjian.us, frederic.yhuel@dalibo.com, nathandbossart@gmail.com, corey.huinker@gmail.com, johncnaylorls@gmail.com, sawada.mshk@gmail.com, pgsql@j-davis.com, jian.universality@gmail.com, boekewurm+postgres@gmail.com, tgl@sss.pgh.pa.us, magnus@hagander.net, sfrost@snowman.net, ashutosh.bapat.oss@gmail.com, smithpb2250@gmail.com, pgsql-hackers@lists.postgresql.org, alvherre@alvh.no-ip.org
  Subject: Re: vacuumdb changes for stats import/export
  In-Reply-To: <aITkuWC4Ww88GsFL@momjian.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox