Re: Emit fewer vacuum records by reaping removable tuples during pruning
Melanie Plageman <melanieplageman@gmail.com>
From: Melanie Plageman <melanieplageman@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>, Peter Geoghegan <pg@bowt.ie>, Pg Hackers <pgsql-hackers@postgresql.org>, Andres Freund <andres@anarazel.de>
Date: 2024-01-05T20:34:22Z
Lists: pgsql-hackers
Attachments
- v3-0004-Inline-LVPagePruneState-members-in-lazy_scan_prun.patch (text/x-patch) patch v3-0004
- v3-0001-Indicate-rel-truncation-unsafe-in-lazy_scan-no-pr.patch (text/x-patch) patch v3-0001
- v3-0003-Update-VM-in-lazy_scan_prune.patch (text/x-patch) patch v3-0003
- v3-0002-Set-would-be-dead-items-LP_UNUSED-while-pruning.patch (text/x-patch) patch v3-0002
- v3-0005-Remove-unneeded-struct-LVPagePruneState.patch (text/x-patch) patch v3-0005
- v3-0006-Conslidate-FSM-update-code-in-lazy_scan_heap.patch (text/x-patch) patch v3-0006
On Fri, Jan 5, 2024 at 1:47 PM Robert Haas <robertmhaas@gmail.com> wrote: > > On Fri, Jan 5, 2024 at 12:59 PM Melanie Plageman > <melanieplageman@gmail.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
Commits
-
Combine FSM updates for prune and no-prune cases.
- 5eafacd2797d 17.0 landed
-
Remove LVPagePruneState.
- e313a6113704 17.0 landed
-
Move VM update code from lazy_scan_heap() to lazy_scan_prune().
- cb970240f13d 17.0 landed
-
Optimize vacuuming of relations with no indexes.
- c120550edb86 17.0 landed
-
Be more consistent about whether to update the FSM while vacuuming.
- 45d395cd75ff 17.0 landed
-
Remove hastup from LVPagePruneState.
- e2d5b3b9b643 17.0 landed
-
Use scanned_pages to decide when to failsafe check.
- 07eef53955ea 16.0 cited
-
Simplify lazy_scan_heap's handling of scanned pages.
- 44fa84881fff 15.0 cited
-
While vacuuming a large table, update upper-level FSM data every so often.
- 851a26e26637 11.0 cited