On Mon, Jan 16, 2023 at 10:10 AM Peter Geoghegan <p...@bowt.ie> wrote: > Attached is v16, which incorporates some of Matthias' feedback.
0001 (the freezing strategies patch) is now committable IMV. Or at least will be once I polish the docs a bit more. I plan on committing 0001 some time next week, barring any objections. I should point out that 0001 is far shorter and simpler than the page-level freezing commit that already went in (commit 1de58df4). The only thing in 0001 that seems like it might be a bit controversial (when considered on its own) is the addition of the vacuum_freeze_strategy_threshold GUC/reloption. Note in particular that vacuum_freeze_strategy_threshold doesn't look like any other existing GUC; it gets applied as a threshold on the size of the rel's main fork at the beginning of vacuumlazy.c processing. As far as I know there are no objections to that approach at this time, but it does still seem worth drawing attention to now. 0001 also makes unlogged tables and temp tables always use eager freezing strategy, no matter how the GUC/reloption are set. This seems *very* easy to justify, since the potential downside of such a policy is obviously extremely low, even when we make very pessimistic assumptions. The usual cost we need to worry about when it comes to freezing is the added WAL overhead -- that clearly won't apply when we're vacuuming non-permanent tables. That really just leaves the cost of dirtying extra pages, which in general could have a noticeable system-level impact in the case of unlogged tables. Dirtying extra pages when vacuuming an unlogged table is also a non-issue. Even the eager freezing strategy only freezes "extra" pages ("extra" relative to the lazy strategy behavior) given a page that will be set all-visible in any case [1]. Such a page will need to have its page-level PD_ALL_VISIBLE bit set in any case -- which is already enough to dirty the page. And so there can never be any additional pages dirtied as a result of the special policy 0001 adds for non-permanent relations. [1] https://wiki.postgresql.org/wiki/Freezing/skipping_strategies_patch:_motivating_examples#Patch_2 -- Peter Geoghegan