On Fri, Jul 28, 2023 at 4:30 PM Andres Freund <and...@anarazel.de> wrote: > Using FPIs having been generated during pruning as part of the logic to decide > whether to freeze makes no sense to me. We likely need some heuristic here, > but I suspect it has to look quite different than the FPI condition.
Why do we need a heuristic at all? What we're talking about here, AIUI, is under what circumstance we should eagerly freeze a page that can be fully frozen, leaving no tuples that vacuum ever needs to worry about again except if the page is further modified. Freezing in such circumstances seems highly likely to work out in our favor. The only argument against it is that the page might soon be modified again, in which case the effort of freezing would be mostly wasted. But I'm not sure whether that's really a valid rationale, because the win from not having to vacuum the page again if it isn't modified seems pretty big, and emitting a freeze record for a page we've just pruned doesn't seem that expensive. If it is a valid rationale, my first thought would be to make the heuristic based on vacuum_freeze_min_age. XID age isn't a particularly great proxy for whether the page is still actively being modified, but at least it has tradition going for it. -- Robert Haas EDB: http://www.enterprisedb.com