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-09T22:42:38Z
Lists: pgsql-hackers
Attachments
- v6-0003-Move-VM-update-code-to-lazy_scan_prune.patch (text/x-patch) patch v6-0003
- v6-0001-Set-would-be-dead-items-LP_UNUSED-while-pruning.patch (text/x-patch) patch v6-0001
- v6-0002-Indicate-rel-truncation-unsafe-in-lazy_scan-no-pr.patch (text/x-patch) patch v6-0002
- v6-0005-Move-freespace-map-update-into-lazy_scan_-no-prun.patch (text/x-patch) patch v6-0005
- v6-0004-Inline-LVPagePruneState-members-in-lazy_scan_prun.patch (text/x-patch) patch v6-0004
On Tue, Jan 9, 2024 at 3:40 PM Robert Haas <robertmhaas@gmail.com> wrote: > > On Tue, Jan 9, 2024 at 3:13 PM Melanie Plageman > <melanieplageman@gmail.com> wrote: > > I had already written the patch for immediate reaping addressing the > > below feedback before I saw the emails that said everyone is happy > > with using hastup in lazy_scan_[no]prune() in a preliminary patch. Let > > me know if you have a strong preference for reordering. Otherwise, I > > will write the three subsequent patches on top of this one. > > I don't know if it rises to the level of a strong preference. It's > just a preference. Attached v6 has the immediate reaping patch first followed by the code to use hastup in lazy_scan_[no]prune(). 0003 and 0004 move the VM update code into lazy_scan_prune() and eliminate LVPagePruneState entirely. 0005 moves the FSM update into lazy_scan_[no]prune(), substantially simplifying lazy_scan_heap(). > I agree that we can leave that out. It wouldn't be bad to include it > if someone had a nice way of doing that, but it doesn't seem critical, > and if forcing it in there makes the comment less clear overall, it's > a net loss IMHO. > > > Hmm. Yes. I suppose I was trying to find something to validate. Is it > > worth checking that the line pointer is not already LP_UNUSED? Or is > > that a bit ridiculous? > > I think that's worthwhile (hence my proposed wording). Done in attached v6. - 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