aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/replication/logical/reorderbuffer.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c
index 264c253a878..64d9baa7982 100644
--- a/src/backend/replication/logical/reorderbuffer.c
+++ b/src/backend/replication/logical/reorderbuffer.c
@@ -328,9 +328,17 @@ ReorderBufferAllocate(void)
SLAB_DEFAULT_BLOCK_SIZE,
sizeof(ReorderBufferTXN));
+ /*
+ * To minimize memory fragmentation caused by long-running transactions
+ * with changes spanning multiple memory blocks, we use a single
+ * fixed-size memory block for decoded tuple storage. The performance
+ * testing showed that the default memory block size maintains logical
+ * decoding performance without causing fragmentation due to concurrent
+ * transactions.
+ */
buffer->tup_context = GenerationContextCreate(new_ctx,
"Tuples",
- SLAB_LARGE_BLOCK_SIZE);
+ SLAB_DEFAULT_BLOCK_SIZE);
hash_ctl.keysize = sizeof(TransactionId);
hash_ctl.entrysize = sizeof(ReorderBufferTXNByIdEnt);