pgsql: Truncate line pointer array during heap pruning.

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Truncate line pointer array during heap pruning.
Date: 2022-04-07 22:43:02
Message-ID: E1ncaqD-000nlp-MP@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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+postgres(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAEze2WjgaQc55Y5f5CQd3L=eS5CZcff2Obxp=O6pto8-f0hC4w@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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2022-04-07 22:53:07 pgsql: pgstat: add/extend tests for resetting various kinds of stats.
Previous Message David Rowley 2022-04-07 22:35:41 pgsql: Teach planner and executor about monotonic window funcs