Truncate line pointer array during heap pruning. Reclaim space from the line pointer array when heap pruning leaves behind a contiguous group of LP_UNUSED items at the end of the array. This happens during subsequent page defragmentation. Certain kinds of heap line pointer bloat are ameliorated by this new optimization.
Follow-up work to commit 3c3b8a4b26, which taught VACUUM to truncate the line pointer array in about the same way during VACUUM's second pass over the heap. We now apply line pointer array truncation during both the first and the second pass over the heap made by VACUUM. We can also perform line pointer array truncation during opportunistic pruning. Matthias van de Meent, with small tweaks by me. Author: Matthias van de Meent <boekewurm+postg...@gmail.com> Discussion: https://postgr.es/m/CAEze2WjgaQc55Y5f5CQd3L=eS5CZcff2Obxp=o6pto8-f0h...@mail.gmail.com Discussion: https://postgr.es/m/CAEze2Wg36%2B4at2eWJNcYNiW2FJmht34x3YeX54ctUSs7kKoNcA%40mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/10a8d138235b3b8cfbce8a0145526d9b9a80cc96 Modified Files -------------- src/backend/access/heap/pruneheap.c | 4 +++- src/backend/access/heap/vacuumlazy.c | 11 ++++++++--- src/backend/storage/page/bufpage.c | 35 ++++++++++++++++++++++------------- 3 files changed, 33 insertions(+), 17 deletions(-)