On Tue, Mar 9, 2021 at 7:13 AM Matthias van de Meent <boekewurm+postg...@gmail.com> wrote: > The shrinking of the line pointer array is already common practice in > indexes (in which all LP_UNUSED items are removed), but this specific > implementation cannot be used for heap pages due to ItemId > invalidation. One available implementation, however, is that we > truncate the end of this array, as mentioned in [1]. There was a > warning at the top of PageRepairFragmentation about not removing > unused line pointers, but I believe that was about not removing > _intermediate_ unused line pointers (which would imply moving in-use > line pointers); as far as I know there is nothing that relies on only > growing page->pd_lower, and nothing keeping us from shrinking it > whilst holding a pin on the page.
Sounds like a good idea to me. -- Peter Geoghegan