Eliminate COPY FREEZE use of XLOG_HEAP2_VISIBLE
authorMelanie Plageman <melanieplageman@gmail.com>
Thu, 9 Oct 2025 20:25:50 +0000 (16:25 -0400)
committerMelanie Plageman <melanieplageman@gmail.com>
Thu, 9 Oct 2025 20:29:01 +0000 (16:29 -0400)
commitd96f87332b3786abd23cba47459546799c562b8c
tree4f4fdd37f5047ec9b09dee98679983c6545999df
parent1b073cba4993b31fbf820504f297efce5d951c00
Eliminate COPY FREEZE use of XLOG_HEAP2_VISIBLE

Instead of emitting a separate WAL XLOG_HEAP2_VISIBLE record for setting
bits in the VM, specify the VM block changes in the
XLOG_HEAP2_MULTI_INSERT record.

This halves the number of WAL records emitted by COPY FREEZE.

Author: Melanie Plageman <melanieplageman@gmail.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Discussion: https://postgr.es/m/flat/CAAKRu_ZMw6Npd_qm2KM%2BFwQ3cMOMx1Dh3VMhp8-V7SOLxdK9-g%40mail.gmail.com
src/backend/access/heap/heapam.c
src/backend/access/heap/heapam_xlog.c
src/backend/access/heap/visibilitymap.c
src/backend/access/rmgrdesc/heapdesc.c
src/include/access/visibilitymap.h