mirror of
https://github.com/postgres/postgres.git
synced 2025-11-24 00:23:06 +03:00
Truncate line pointer array during VACUUM.
Teach VACUUM to truncate the line pointer array of each heap page when a contiguous group of LP_UNUSED line pointers appear at the end of the array -- these unused and unreferenced items are excluded. This process occurs during VACUUM's second pass over the heap, right after LP_DEAD line pointers on the page (those encountered/pruned during the first pass) are marked LP_UNUSED. Truncation avoids line pointer bloat with certain workloads, particularly those involving continual range DELETEs and bulk INSERTs against the same table. Also harden heapam code to check for an out-of-range page offset number in places where we weren't already doing so. Author: Matthias van de Meent <boekewurm+postgres@gmail.com> Author: Peter Geoghegan <pg@bowt.ie> Reviewed-By: Masahiko Sawada <sawada.mshk@gmail.com> Reviewed-By: Peter Geoghegan <pg@bowt.ie> Discussion: https://postgr.es/m/CAEze2WjgaQc55Y5f5CQd3L=eS5CZcff2Obxp=O6pto8-f0hC4w@mail.gmail.com Discussion: https://postgr.es/m/CAH2-Wzn6a64PJM1Ggzm=uvx2otsopJMhFQj_g1rAj4GWr3ZSzw@mail.gmail.com
This commit is contained in:
@@ -441,6 +441,7 @@ extern Page PageGetTempPageCopy(Page page);
|
||||
extern Page PageGetTempPageCopySpecial(Page page);
|
||||
extern void PageRestoreTempPage(Page tempPage, Page oldPage);
|
||||
extern void PageRepairFragmentation(Page page);
|
||||
extern void PageTruncateLinePointerArray(Page page);
|
||||
extern Size PageGetFreeSpace(Page page);
|
||||
extern Size PageGetFreeSpaceForMultipleTuples(Page page, int ntups);
|
||||
extern Size PageGetExactFreeSpace(Page page);
|
||||
|
||||
Reference in New Issue
Block a user