From d96f87332b3786abd23cba47459546799c562b8c Mon Sep 17 00:00:00 2001 From: Melanie Plageman Date: Thu, 9 Oct 2025 16:25:50 -0400 Subject: 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 Reviewed-by: Andres Freund Reviewed-by: Robert Haas Reviewed-by: Kirill Reshke Discussion: https://postgr.es/m/flat/CAAKRu_ZMw6Npd_qm2KM%2BFwQ3cMOMx1Dh3VMhp8-V7SOLxdK9-g%40mail.gmail.com --- src/include/access/visibilitymap.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/include/access/visibilitymap.h') diff --git a/src/include/access/visibilitymap.h b/src/include/access/visibilitymap.h index be21c6dd1a3..c6fa37be968 100644 --- a/src/include/access/visibilitymap.h +++ b/src/include/access/visibilitymap.h @@ -18,6 +18,7 @@ #include "access/xlogdefs.h" #include "storage/block.h" #include "storage/buf.h" +#include "storage/relfilelocator.h" #include "utils/relcache.h" /* Macros for visibilitymap test */ @@ -37,6 +38,9 @@ extern uint8 visibilitymap_set(Relation rel, Buffer vmBuf, TransactionId cutoff_xid, uint8 flags); +extern uint8 visibilitymap_set_vmbits(BlockNumber heapBlk, + Buffer vmBuf, uint8 flags, + const RelFileLocator rlocator); extern uint8 visibilitymap_get_status(Relation rel, BlockNumber heapBlk, Buffer *vmbuf); extern void visibilitymap_count(Relation rel, BlockNumber *all_visible, BlockNumber *all_frozen); extern BlockNumber visibilitymap_prepare_truncate(Relation rel, -- cgit v1.2.3