On Thu, Jan 19, 2023 at 12:58 PM Andres Freund <and...@anarazel.de> wrote: > There's absolutely no guarantee that autoanalyze is triggered > there. Particularly with repeated vacuums triggered due to an relfrozenxid age > that can't be advanced that very well might not happen within days on a large > relation.
Arguments like that work far better as arguments in favor of the vac_estimate_reltuples heuristics. That doesn't mean that the heuristics are good in any absolute sense, of course. They were just a band aid intended to ameliorate some of the negative impact that came from treating scanned_pages as a random sample. I think that we both agree that the real problem is that scanned_pages just isn't a random sample, at least not as far as reltuples/live tuples is concerned (for dead tuples it kinda isn't a sample, but is rather something close to an exact count). I now understand that you're in favor of addressing the root problem directly. I am also in favor of that approach. I'd be more than happy to get rid of the band aid as part of that whole effort. -- Peter Geoghegan