vacuumdb --missing-stats-only and pg_upgrade from PG13
Christoph Berg <myon@debian.org>
From: Christoph Berg <myon@debian.org>
To: Nathan Bossart <nathan@postgresql.org>, Corey Huinker <corey.huinker@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2025-04-23T14:01:33Z
Lists: pgsql-hackers
Re: To Nathan Bossart > > Update guidance for running vacuumdb after pg_upgrade. > > > > Now that pg_upgrade can carry over most optimizer statistics, we > > should recommend using vacuumdb's new --missing-stats-only option > > to only analyze relations that are missing statistics. > > I've been looking at vacuumdb --missing-stats-only because Debian's > pg_upgradecluster is using that now. The reason I was looking closely yesterday is because Debian's regression tests were tripping over it, but I only figured out the problem today: If I create a table in a PG13-or-earlier cluster, never ANALYZE it, and then pg_upgrade to 18 and run vacuumdb --analyze-only --missing-stats-only, the table will not get analyzed. The only table visited there is pg_largeobject. Upgrades from 14..17 are fine. Christoph
Commits
-
Further adjust guidance for running vacuumdb after pg_upgrade.
- d5f1b6a75ba3 18.0 landed
-
vacuumdb: Don't skip empty relations in --missing-stats-only mode.
- 987910502420 18.0 landed
-
Update guidance for running vacuumdb after pg_upgrade.
- c9d502eb6809 18.0 cited
-
Redefine pg_class.reltuples to be -1 before the first VACUUM or ANALYZE.
- 3d351d916b20 14.0 cited