Skip to content

Commit 0810e1f

Browse files
committed
Add GUC on distributed execution paths
1 parent 97c3440 commit 0810e1f

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

contrib/pg_exchange/hooks.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ HOOK_Baserel_paths(PlannerInfo *root, RelOptInfo *rel, Index rti,
3939
if (prev_set_rel_pathlist_hook)
4040
(*prev_set_rel_pathlist_hook) (root, rel, rti, rte);
4141

42-
add_exchange_paths(root, rel, rti, rte);
42+
if (enable_distributed_execution)
43+
add_exchange_paths(root, rel, rti, rte);
4344
}
4445

4546
static bool

contrib/pg_exchange/nodeDistPlanExec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static CustomScanMethods distplanexec_plan_methods;
4444
static CustomExecMethods distplanexec_exec_methods;
4545

4646
char destsName[10] = "DMQ_DESTS";
47-
char *network_interface;
47+
bool enable_distributed_execution;
4848

4949

5050
static Node *CreateDistPlanExecState(CustomScan *node);

contrib/pg_exchange/nodeDistPlanExec.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ typedef struct
2727
} lcontext;
2828

2929

30-
extern char *network_interface;
30+
extern bool enable_distributed_execution;
3131
extern char destsName[10];
3232
#define DISTEXECPATHNAME "DistExecPath"
3333

contrib/pg_exchange/pg_exchange.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,16 @@ shmem_size(void)
6969
void
7070
_PG_init(void)
7171
{
72-
DefineCustomStringVariable("network_interface",
73-
"Set network interface for EXCHANGE communications",
74-
NULL, &network_interface, "lo",
75-
PGC_SUSET, GUC_NOT_IN_SAMPLE, NULL, NULL, NULL);
72+
DefineCustomBoolVariable("enable_distributed_execution",
73+
"Use distributed execution.",
74+
NULL,
75+
&enable_distributed_execution,
76+
true,
77+
PGC_USERSET,
78+
GUC_NOT_IN_SAMPLE,
79+
NULL,
80+
NULL,
81+
NULL);
7682

7783
EXCHANGE_Init_methods();
7884
DUMMYSCAN_Init_methods();

0 commit comments

Comments
 (0)