Re: Emit fewer vacuum records by reaping removable tuples during pruning

From: Melanie Plageman <melanieplageman(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Peter Geoghegan <pg(at)bowt(dot)ie>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: Emit fewer vacuum records by reaping removable tuples during pruning
Date: 2024-01-05 20:34:22
Message-ID: CAAKRu_aTV=jOeZG0DqVC27=qS-+p1dypjPqs2z+tnJr+XTO6ag@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 5, 2024 at 1:47 PM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>
> On Fri, Jan 5, 2024 at 12:59 PM Melanie Plageman
> <melanieplageman(at)gmail(dot)com> wrote:
> MP> I am planning to add a VM update into the freeze record, at which point
> MP> I will move the VM update code into lazy_scan_prune(). This will then
> MP> allow us to consolidate the freespace map update code for the prune and
> MP> noprune cases and make lazy_scan_heap() short and sweet.
>
> Can we see what that looks like on top of this change?

Yes, attached is a patch set which does this. My previous patchset
already reduced the number of places we unlock the buffer and update
the freespace map in lazy_scan_heap(). This patchset combines the
lazy_scan_prune() and lazy_scan_noprune() FSM update cases. I also
have a version which moves the freespace map updates into
lazy_scan_prune() and lazy_scan_noprune() -- eliminating all of these
from lazy_scan_heap(). This is arguably more clear. But Andres
mentioned he wanted fewer places unlocking the buffer and updating the
FSM.

- Melanie

Attachment Content-Type Size
v3-0004-Inline-LVPagePruneState-members-in-lazy_scan_prun.patch text/x-patch 10.3 KB
v3-0001-Indicate-rel-truncation-unsafe-in-lazy_scan-no-pr.patch text/x-patch 7.0 KB
v3-0003-Update-VM-in-lazy_scan_prune.patch text/x-patch 10.5 KB
v3-0002-Set-would-be-dead-items-LP_UNUSED-while-pruning.patch text/x-patch 17.1 KB
v3-0005-Remove-unneeded-struct-LVPagePruneState.patch text/x-patch 4.2 KB
v3-0006-Conslidate-FSM-update-code-in-lazy_scan_heap.patch text/x-patch 3.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2024-01-05 20:57:30 Re: Emit fewer vacuum records by reaping removable tuples during pruning
Previous Message Andres Freund 2024-01-05 20:34:06 Re: Build versionless .so for Android