Re: vacuumdb changes for stats import/export

Frédéric Yhuel <frederic.yhuel@dalibo.com>

From: Frédéric Yhuel <frederic.yhuel@dalibo.com>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Corey Huinker <corey.huinker@gmail.com>, Bruce Momjian <bruce@momjian.us>, "David G. Johnston" <david.g.johnston@gmail.com>, John Naylor <johncnaylorls@gmail.com>, Masahiko Sawada <sawada.mshk@gmail.com>, Jeff Davis <pgsql@j-davis.com>, jian he <jian.universality@gmail.com>, Matthias van de Meent <boekewurm+postgres@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Magnus Hagander <magnus@hagander.net>, Stephen Frost <sfrost@snowman.net>, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>, Peter Smith <smithpb2250@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, alvherre@alvh.no-ip.org
Date: 2025-07-28T15:09:15Z
Lists: pgsql-hackers

On 7/28/25 16:47, Nathan Bossart wrote:
> I can't remember who wrote this line, but it was borrowed from the
> --analyze-in-stages description.  The point is that if you use
> --analyze-in-stages without --missing-stats-only, there will be a period
> where existing statistics will be replaced with ones generated with lower
> statistics targets.

Aha, it makes sense now, thank you!

> Obviously, this wording isn't clear enough.  We might
> need to either remove that sentence or add "When used in conjunction with
> --analyze-in-stages..."

I vote for the second option.




Commits

  1. doc: Adjust documentation for vacuumdb --missing-stats-only.

  2. Update guidance for running vacuumdb after pg_upgrade.

  3. vacuumdb: Add option for analyzing only relations missing stats.

  4. vacuumdb: Teach vacuum_one_database() to reuse query results.