Optimize SnapBuildPurgeOlderTxn to purge committed xids in-place

From: Neil Chen <carpenter(dot)nail(dot)cz(at)gmail(dot)com>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Optimize SnapBuildPurgeOlderTxn to purge committed xids in-place
Date: 2026-01-08 03:34:48
Message-ID: CAA3qoJm+R03tzF_2p4Syck4Nwx1dGBsusN25frGx4NGnT_ck2Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

While reading the code of SnapBuildPurgeOlderTxn, I noticed the TODO
comment suggesting a neater algorithm instead of using a temporary
workspace for copying committed xids.

I’ve implemented an in-place purge approach for the committed xid array to
eliminate the overhead of memory allocation and data copying.

Tested locally without issues—happy to hear your thoughts.

Attachment Content-Type Size
v1-0001-Optimize-SnapBuildPurgeOlderTxn-to-purge-committed-x.patch application/octet-stream 2.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Japin Li 2026-01-08 03:37:42 Re: Pasword expiration warning
Previous Message Richard Guo 2026-01-08 03:23:36 Re: Fwd: pg18 bug? SELECT query doesn't work