v1-0002-poc-test-parallel_tuple_queue_size.patch
text/x-patch
Filename: v1-0002-poc-test-parallel_tuple_queue_size.patch
Type: text/x-patch
Part: 2
Message:
Re: Gather performance analysis
Patch
Format: format-patch
Series: patch v1-0002
Subject: poc-test-parallel_tuple_queue_size
| File | + | − |
|---|---|---|
| src/backend/executor/execParallel.c | 2 | 1 |
| src/backend/utils/misc/guc.c | 10 | 0 |
| src/include/storage/pg_shmem.h | 1 | 0 |
From 455026b0f70eec8acf3565824c03a9e20588e9cc Mon Sep 17 00:00:00 2001
From: Dilip Kumar <dilipkumar@localhost.localdomain>
Date: Mon, 26 Jul 2021 20:18:48 +0530
Subject: [PATCH v1 2/2] poc-test-parallel_tuple_queue_size
---
src/backend/executor/execParallel.c | 3 ++-
src/backend/utils/misc/guc.c | 10 ++++++++++
src/include/storage/pg_shmem.h | 1 +
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/backend/executor/execParallel.c b/src/backend/executor/execParallel.c
index f8a4a40..f9dd5fc 100644
--- a/src/backend/executor/execParallel.c
+++ b/src/backend/executor/execParallel.c
@@ -51,6 +51,7 @@
#include "utils/memutils.h"
#include "utils/snapmgr.h"
+int parallel_tuple_queue_size = 65536;
/*
* Magic numbers for parallel executor communication. We use constants
* greater than any 32-bit integer here so that values < 2^32 can be used
@@ -67,7 +68,7 @@
#define PARALLEL_KEY_JIT_INSTRUMENTATION UINT64CONST(0xE000000000000009)
#define PARALLEL_KEY_WAL_USAGE UINT64CONST(0xE00000000000000A)
-#define PARALLEL_TUPLE_QUEUE_SIZE 65536
+#define PARALLEL_TUPLE_QUEUE_SIZE parallel_tuple_queue_size * 1024L
/*
* Fixed-size random stuff that we need to pass to parallel workers.
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index c339acf..4d5dca5 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -3346,6 +3346,16 @@ static struct config_int ConfigureNamesInt[] =
},
{
+ {"parallel_tuple_queue_size", PGC_USERSET, RESOURCES_MEM,
+ gettext_noop("Sets the parallel tuple queue size."),
+ GUC_UNIT_KB
+ },
+ ¶llel_tuple_queue_size,
+ 64, 64, MAX_KILOBYTES,
+ NULL, NULL, NULL
+ },
+
+ {
{"autovacuum_work_mem", PGC_SIGHUP, RESOURCES_MEM,
gettext_noop("Sets the maximum memory to be used by each autovacuum worker process."),
NULL,
diff --git a/src/include/storage/pg_shmem.h b/src/include/storage/pg_shmem.h
index 059df1b..9182a0e 100644
--- a/src/include/storage/pg_shmem.h
+++ b/src/include/storage/pg_shmem.h
@@ -45,6 +45,7 @@ typedef struct PGShmemHeader /* standard header for all Postgres shmem */
extern int shared_memory_type;
extern int huge_pages;
extern int huge_page_size;
+extern int parallel_tuple_queue_size;
/* Possible values for huge_pages */
typedef enum
--
1.8.3.1