]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Use the newest to-be-frozen xid as the conflict horizon for freezing
authorMelanie Plageman <melanieplageman@gmail.com>
Tue, 10 Mar 2026 19:24:39 +0000 (15:24 -0400)
committerMelanie Plageman <melanieplageman@gmail.com>
Tue, 10 Mar 2026 19:24:39 +0000 (15:24 -0400)
commitc2a23dcf9e3af1c80a99b4ee43f0885eb6894e3a
treef72f6e5753f8ea710219777db977103d82d523e0
parentac58465e0618941842439eb3f5a2cf8bebd5a3f1
Use the newest to-be-frozen xid as the conflict horizon for freezing

Previously WAL records that froze tuples used OldestXmin as the snapshot
conflict horizon, or the visibility cutoff if the page would become
all-frozen. Both are newer than (or equal to) the newst XID actually
frozen on the page.

Track the newest XID that will be frozen and use that as the snapshot
conflict horizon instead. This yields an older horizon resulting in
fewer query cancellations on standbys.

Author: Melanie Plageman <melanieplageman@gmail.com>
Reviewed-by: Peter Geoghegan <pg@bowt.ie>
Discussion: https://postgr.es/m/CAAKRu_bbaUV8OUjAfVa_iALgKnTSfB4gO3jnkfpcFgrxEpSGJQ%40mail.gmail.com
src/backend/access/heap/heapam.c
src/backend/access/heap/pruneheap.c
src/include/access/heapam.h