Re: 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. I am wondering if this is really good advice in the pg_upgrade documentation. Sure it's nice that optimizer statistics are carried over by pg_upgrade, but the pg_stat_user_tables statistics are not carried over, and afaict these are the numbers that determine when the next autovacuum or autoanalyze run is going to happen. By removing the "please run vacuumdb on all tables" step from the pg_upgrade docs, we are effectively telling everyone that they should be starting with these numbers all 0, postponing the next run to some indeterminate point. Running `vacuumdb --missing-stats-only` does not fix that because it's skipping the tables. Is that the message we want to send? (If I am misinterpreting the situation the docs should still explain why this is ok.) Christoph