On Thu, Jan 27, 2022 at 11:22 PM Laurenz Albe <laurenz.a...@cybertec.at> wrote: > What would you suggest instead? pg_stat_all_tables.n_live_tup?
I'm not sure, except that I assume that it'll have to come from the statistics collector, not from pg_class. I think that this bug stemmed from the fact that vac_update_relstats() is used by both VACUUM and ANALYZE to store information in pg_class, while both *also* use pgstat_report_vacuum()/pgstat_report_analyze() to store closely related information at the same point. There is rather a lot of implicit information here. I recall a few other bugs that also seemed related to this messiness with statistics and pg_class. -- Peter Geoghegan