Re: Why is INSERT-driven autovacuuming based on pg_class.reltuples? - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Why is INSERT-driven autovacuuming based on pg_class.reltuples?
Date
Msg-id CAH2-Wz=AyRW9xZ4OYbWA7+0z3+gAwhzzJB0uJWHQrzAEa-b2Ag@mail.gmail.com
Whole thread Raw
In response to Re: Why is INSERT-driven autovacuuming based on pg_class.reltuples?  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-hackers
On Thu, Jan 27, 2022 at 11:22 PM Laurenz Albe <laurenz.albe@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



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Bugs in pgoutput.c
Next
From: Jeevan Ladhe
Date:
Subject: Re: refactoring basebackup.c