Eliminate redundant tuple visibility check in vacuum
Melanie Plageman <melanieplageman@gmail.com>
From: Melanie Plageman <melanieplageman@gmail.com>
To: Pg Hackers <pgsql-hackers@postgresql.org>
Cc: Andres Freund <andres@anarazel.de>
Date: 2023-08-28T23:49:27Z
Lists: pgsql-hackers
Attachments
- v1-0002-Reuse-heap_page_prune-tuple-visibility-statuses.patch (application/x-patch) patch v1-0002
- v1-0001-Rebrand-LVPagePruneState-as-PruneResult.patch (application/x-patch) patch v1-0001
While working on a set of patches to combine the freeze and visibility map WAL records into the prune record, I wrote the attached patches reusing the tuple visibility information collected in heap_page_prune() back in lazy_scan_prune(). heap_page_prune() collects the HTSV_Result for every tuple on a page and saves it in an array used by heap_prune_chain(). If we make that array available to lazy_scan_prune(), it can use it when collecting stats for vacuum and determining whether or not to freeze tuples. This avoids calling HeapTupleSatisfiesVacuum() again on every tuple in the page. It also gets rid of the retry loop in lazy_scan_prune(). - Melanie
Commits
-
Remove retry loop in heap_page_prune().
- 1ccc1e05ae8f 17.0 landed
-
Return data from heap_page_prune via a struct.
- 4e9fc3a97620 17.0 landed