Eliminate redundant tuple visibility check in vacuum

From: Melanie Plageman <melanieplageman(at)gmail(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Andres Freund <andres(at)anarazel(dot)de>
Subject: Eliminate redundant tuple visibility check in vacuum
Date: 2023-08-28 23:49:27
Message-ID: CAAKRu_br124qsGJieuYA0nGjywEukhK1dKBfRdby_4yY3E9SXA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
v1-0002-Reuse-heap_page_prune-tuple-visibility-statuses.patch application/x-patch 14.8 KB
v1-0001-Rebrand-LVPagePruneState-as-PruneResult.patch application/x-patch 14.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2023-08-28 23:55:48 Re: Debian 12 gcc warning
Previous Message Michael Paquier 2023-08-28 23:47:29 Re: Return value of pg_promote()