On Wed, Aug 4, 2021 at 12:09 PM Simon Riggs <simon.ri...@enterprisedb.com> wrote: > Truncating line pointers can make extra space on the page, so it could > be the difference between a HOT and a non-HOT update. My understanding > is that these just-in-time actions have a beneficial effect in other > circumstances, so we can do that here also.
I would prefer if the arguments in favor were a little more concrete. Maybe in general they don't have to be. But that would be my preference, and what I would look if I was to commit such a patch. > If the only thing we do to a page is truncate line pointers then it > may not be worth it. But dirtying a page to reclaim space is also the > precise time when reclaiming line pointers makes sense also. So if the > page is dirtied by cleaning, then that is the time to reclaim line > pointers also. > > Again, why would we reclaim space to avoid bloat but then ignore any > line pointer bloat? I don't think that my mental model is significantly different to yours here. Like everybody else, I can easily imagine how this *might* have value. All I'm really saying is that a burden of proof exists for this patch (or any performance orientated patch). In my opinion that burden has yet to be met by this patch. My guess is that Matthias can show a clear, measurable benefit with a little more work. If that happens then all of my marginal concerns about the risk of bugs become relatively unimportant. It might even be okay to commit the patch on the basis of "what could the harm be?" if there was some effort to demonstrate empirically that the performance downside really was zero. > It's not clear why truncating unused line pointers would break DDL. I'm just saying that it's obviously not possible now, with the VACUUM-only PageTruncateLinePointerArray()/lazy_vacuum_heap_page() code path added to Postgres 14 -- because VACUUM's relation-level lock makes sure of that. That property has some value. Certainly not enough value to block progress on a feature that is clearly useful, but enough to give me pause. -- Peter Geoghegan