On Fri, Dec 30, 2022 at 1:12 PM Peter Geoghegan <p...@bowt.ie> wrote: > > "Nominal freezing" is happening when there are no freeze plans at all. > > I get that it's to manage control flow so that the right thing happens > > later. But I think it should be defined in terms of what state the page > > is in so that we know that following a given path is valid. Defining > > "nominal freezing" as a case where there are no freeze plans is just > > confusing to me. > > What would you prefer? The state that the page is in is not something > that I want to draw much attention to, because it's confusing in a way > that mostly isn't worth talking about.
I probably should have addressed what you said more directly. Here goes: Following the path of freezing a page is *always* valid, by definition. Including when there are zero freeze plans to execute, or even zero tuples to examine in the first place -- we'll at least be able to perform nominal freezing, no matter what. OTOH, following the "no freeze" path is permissible whenever the freeze_required flag hasn't been set during any call to heap_prepare_freeze_tuple(). It is never actually mandatory for lazy_scan_prune() to *not* freeze. It's a bit like how a simple point can be understood as a degenerate circle of radius 0. It's an abstract definition, which is just a tool for describing things precisely -- hopefully a useful tool. I welcome the opportunity to be able to describe things in a way that is clearer or more useful, in whatever way. But it's not like I haven't already put in significant effort to this exact question of what "freezing the page" really means to lazy_scan_prune(). Naming things is hard. -- Peter Geoghegan