Re: Lowering the ever-growing heap->pd_lower - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Lowering the ever-growing heap->pd_lower
Date
Msg-id CAH2-Wz=0vn06B8cYC5zcQAtDxJNgHjxgjv0hBcSkFC3wA4zuCw@mail.gmail.com
Whole thread Raw
In response to Re: Lowering the ever-growing heap->pd_lower  (Matthias van de Meent <boekewurm+postgres@gmail.com>)
Responses Re: Lowering the ever-growing heap->pd_lower  (Matthias van de Meent <boekewurm+postgres@gmail.com>)
List pgsql-hackers
On Tue, Aug 3, 2021 at 12:27 PM Matthias van de Meent
<boekewurm+postgres@gmail.com> wrote:
> This change makes it easier and more worthwile to implement a further
> optimization for the checkpointer and/or buffer manager to determine
> that 1.) this page is now empty, and that 2.) we can therefore write a
> specialized WAL record specifically tuned for empty pages instead of
> FPI records. No additional pages are changed, because each time the
> line pointer array is shrunk, we've already either marked dead tuples
> as unused (2nd phase vacuum) or removed HOT line pointers / truncated
> dead tuples to lp_dead line pointers (heap_page_prune).

We generate an FPI the first time a page is modified after a
checkpoint. The FPI consists of the page *after* it has been modified.
Presumably this optimization would need the heap page to be 100%
empty, so we're left with what seems to me to be a very narrow target
for optimization; something that is naturally rare.

A fully-empty page seems quite unlikely in the case of xl_heap_vacuum
records, and impossible in the case of xl_heap_prune records. Even
with all the patches, working together. Have I missed something?

-- 
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Commitfest overflow
Next
From: Amit Kapila
Date:
Subject: Re: Failed transaction statistics to measure the logical replication progress