diff options
author | Melanie Plageman <melanieplageman@gmail.com> | 2025-10-09 16:25:50 -0400 |
---|---|---|
committer | Melanie Plageman <melanieplageman@gmail.com> | 2025-10-09 16:29:01 -0400 |
commit | d96f87332b3786abd23cba47459546799c562b8c (patch) | |
tree | 4f4fdd37f5047ec9b09dee98679983c6545999df /src/include/access/visibilitymap.h | |
parent | 1b073cba4993b31fbf820504f297efce5d951c00 (diff) |
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
Diffstat (limited to 'src/include/access/visibilitymap.h')
-rw-r--r-- | src/include/access/visibilitymap.h | 4 |
1 files changed, 4 insertions, 0 deletions
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, |