Skip to content

Commit 1eb3088

Browse files
committed
Retire GUC parallel_hash_enable_motion_broadcast
It's added by history reasons as a workaround. We don't have exactly the right parallel feature at the time. It's neither reasonable to keep it, nor we have test cases for this wired GUC. Retire it and keep codes same with UPSTREAM. Authored-by: Zhang Mingli [email protected]
1 parent fc90fec commit 1eb3088

8 files changed

Lines changed: 11 additions & 65 deletions

File tree

src/backend/cdb/cdbpath.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2871,8 +2871,7 @@ cdbpath_motion_for_parallel_join(PlannerInfo *root,
28712871
List *inner_pathkeys,
28722872
bool outer_require_existing_order,
28732873
bool inner_require_existing_order,
2874-
bool parallel_aware,
2875-
bool uninterested_broadcast)
2874+
bool parallel_aware)
28762875
{
28772876
CdbpathMfjRel outer;
28782877
CdbpathMfjRel inner;
@@ -3699,7 +3698,7 @@ cdbpath_motion_for_parallel_join(PlannerInfo *root,
36993698
else if (!small_rel->require_existing_order &&
37003699
small_rel->ok_to_replicate &&
37013700
((!parallel_aware && (small_rel->bytes * CdbPathLocus_NumSegmentsPlusParallelWorkers(large_rel->locus) < large_rel->bytes)) ||
3702-
(parallel_aware && !uninterested_broadcast && (small_rel->bytes * CdbPathLocus_NumSegments(large_rel->locus) < large_rel->bytes))))
3701+
(parallel_aware && (small_rel->bytes * CdbPathLocus_NumSegments(large_rel->locus) < large_rel->bytes))))
37033702
{
37043703
if (!parallel_aware)
37053704
CdbPathLocus_MakeReplicated(&small_rel->move_to,
@@ -3718,7 +3717,7 @@ cdbpath_motion_for_parallel_join(PlannerInfo *root,
37183717
else if (!large_rel->require_existing_order &&
37193718
large_rel->ok_to_replicate &&
37203719
((!parallel_aware && (large_rel->bytes * CdbPathLocus_NumSegmentsPlusParallelWorkers(small_rel->locus) < small_rel->bytes)) ||
3721-
(parallel_aware && !uninterested_broadcast && (large_rel->bytes * CdbPathLocus_NumSegments(small_rel->locus) < small_rel->bytes))))
3720+
(parallel_aware && (large_rel->bytes * CdbPathLocus_NumSegments(small_rel->locus) < small_rel->bytes))))
37223721
{
37233722
if (!parallel_aware)
37243723
CdbPathLocus_MakeReplicated(&large_rel->move_to,
@@ -3749,7 +3748,7 @@ cdbpath_motion_for_parallel_join(PlannerInfo *root,
37493748
else if (!small_rel->require_existing_order &&
37503749
small_rel->ok_to_replicate &&
37513750
((!parallel_aware && (small_rel->bytes * CdbPathLocus_NumSegmentsPlusParallelWorkers(large_rel->locus) < small_rel->bytes + large_rel->bytes)) ||
3752-
(parallel_aware && !uninterested_broadcast && (small_rel->bytes * CdbPathLocus_NumSegments(large_rel->locus) < small_rel->bytes + large_rel->bytes))))
3751+
(parallel_aware && (small_rel->bytes * CdbPathLocus_NumSegments(large_rel->locus) < small_rel->bytes + large_rel->bytes))))
37533752
{
37543753
if (!parallel_aware)
37553754
CdbPathLocus_MakeReplicated(&small_rel->move_to,
@@ -3765,7 +3764,7 @@ cdbpath_motion_for_parallel_join(PlannerInfo *root,
37653764
else if (!large_rel->require_existing_order &&
37663765
large_rel->ok_to_replicate &&
37673766
((!parallel_aware && (large_rel->bytes * CdbPathLocus_NumSegmentsPlusParallelWorkers(small_rel->locus) < small_rel->bytes + large_rel->bytes)) ||
3768-
(parallel_aware && !uninterested_broadcast && (large_rel->bytes * CdbPathLocus_NumSegments(small_rel->locus) < small_rel->bytes + large_rel->bytes))))
3767+
(parallel_aware && (large_rel->bytes * CdbPathLocus_NumSegments(small_rel->locus) < small_rel->bytes + large_rel->bytes))))
37693768
{
37703769
if (!parallel_aware)
37713770
CdbPathLocus_MakeReplicated(&large_rel->move_to,

src/backend/optimizer/path/joinpath.c

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,40 +1147,6 @@ try_partial_hashjoin_path(PlannerInfo *root,
11471147
if (!add_partial_path_precheck(joinrel, workspace.total_cost, NIL))
11481148
return;
11491149

1150-
/*
1151-
* CBDB_PARALLEL_FIXME
1152-
* Customers encounter an issue that when parallel hash, broadcast motion
1153-
* a smaller table may be worser than redistribute a big table.
1154-
* We add a path whic doesn't try broadcast if possible.
1155-
* And let the path cost decide which is better.
1156-
*/
1157-
if (parallel_hash)
1158-
{
1159-
hashpath = create_hashjoin_path(root,
1160-
joinrel,
1161-
jointype,
1162-
orig_jointype,
1163-
&workspace,
1164-
extra,
1165-
outer_path,
1166-
inner_path,
1167-
true,
1168-
extra->restrictlist,
1169-
NULL,
1170-
extra->redistribution_clauses,
1171-
hashclauses,
1172-
true); /* not use broadcast */
1173-
if (hashpath && hashpath->parallel_safe)
1174-
add_partial_path(joinrel, hashpath);
1175-
}
1176-
1177-
/*
1178-
* CBDB_PARALLEL_FIXME:
1179-
* We only want non-broadcast in parallel hash if the guc is set.
1180-
*/
1181-
if (parallel_hash && !parallel_hash_enable_motion_broadcast)
1182-
return;
1183-
11841150
hashpath = create_hashjoin_path(root,
11851151
joinrel,
11861152
jointype,
@@ -1193,8 +1159,8 @@ try_partial_hashjoin_path(PlannerInfo *root,
11931159
extra->restrictlist,
11941160
NULL,
11951161
extra->redistribution_clauses,
1196-
hashclauses,
1197-
false);
1162+
hashclauses);
1163+
11981164
/* Might be good enough to be worth trying and no motion, so let's try it. */
11991165
if (hashpath && hashpath->parallel_safe)
12001166
add_partial_path(joinrel, hashpath);

src/backend/optimizer/util/pathnode.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3911,7 +3911,6 @@ create_nestloop_path(PlannerInfo *root,
39113911
NIL,
39123912
outer_must_be_local,
39133913
inner_must_be_local,
3914-
false,
39153914
false);
39163915
}
39173916

@@ -4191,7 +4190,6 @@ create_mergejoin_path(PlannerInfo *root,
41914190
innermotionkeys,
41924191
preserve_outer_ordering,
41934192
preserve_inner_ordering,
4194-
false,
41954193
false);
41964194
}
41974195

@@ -4332,8 +4330,7 @@ create_hashjoin_path(PlannerInfo *root,
43324330
List *restrict_clauses,
43334331
Relids required_outer,
43344332
List *redistribution_clauses, /* CDB */
4335-
List *hashclauses,
4336-
bool uninterested_broadcast) /* GPDB parallel */
4333+
List *hashclauses)
43374334
{
43384335
HashPath *pathnode;
43394336
CdbPathLocus join_locus;
@@ -4378,8 +4375,7 @@ create_hashjoin_path(PlannerInfo *root,
43784375
NIL,
43794376
outer_must_be_local,
43804377
inner_must_be_local,
4381-
parallel_hash,
4382-
uninterested_broadcast);
4378+
parallel_hash);
43834379
}
43844380

43854381
if (CdbPathLocus_IsNull(join_locus))

src/backend/utils/misc/guc_gp.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,6 @@ bool optimizer_enable_indexjoin;
303303
bool optimizer_enable_motions_masteronly_queries;
304304
bool optimizer_enable_motions;
305305
bool optimizer_enable_motion_broadcast;
306-
bool parallel_hash_enable_motion_broadcast;
307306
bool optimizer_enable_motion_gather;
308307
bool optimizer_enable_motion_redistribute;
309308
bool optimizer_enable_sort;
@@ -2090,16 +2089,6 @@ struct config_bool ConfigureNamesBool_gp[] =
20902089
true,
20912090
NULL, NULL, NULL
20922091
},
2093-
{
2094-
{"parallel_hash_enable_motion_broadcast", PGC_USERSET, DEVELOPER_OPTIONS,
2095-
gettext_noop("Enable plans with Motion Broadcast operators in parallel hash join."),
2096-
NULL,
2097-
GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE
2098-
},
2099-
&parallel_hash_enable_motion_broadcast,
2100-
true,
2101-
NULL, NULL, NULL
2102-
},
21032092
{
21042093
{"optimizer_enable_motion_gather", PGC_USERSET, DEVELOPER_OPTIONS,
21052094
gettext_noop("Enable plans with Motion Gather operators in the optimizer."),

src/include/cdb/cdbpath.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ cdbpath_motion_for_parallel_join(PlannerInfo *root,
7474
List *inner_pathkeys,
7575
bool outer_require_existing_order,
7676
bool inner_require_existing_order,
77-
bool parallel_aware,
78-
bool uninterested_broadcast); /* for parallel hash join, do not use Broadcast if possible */
77+
bool parallel_aware);
7978

8079
#endif /* CDBPATH_H */

src/include/optimizer/pathnode.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,7 @@ extern Path *create_hashjoin_path(PlannerInfo *root,
216216
List *restrict_clauses,
217217
Relids required_outer,
218218
List *redistribution_clauses, /*CDB*/
219-
List *hashclauses,
220-
bool uninterested_broadcast); /* GPDB parallel */
219+
List *hashclauses);
221220

222221
extern ProjectionPath *create_projection_path(PlannerInfo *root,
223222
RelOptInfo *rel,

src/include/utils/guc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,6 @@ extern bool optimizer_enable_indexjoin;
496496
extern bool optimizer_enable_motions_masteronly_queries;
497497
extern bool optimizer_enable_motions;
498498
extern bool optimizer_enable_motion_broadcast;
499-
extern bool parallel_hash_enable_motion_broadcast;
500499
extern bool optimizer_enable_motion_gather;
501500
extern bool optimizer_enable_motion_redistribute;
502501
extern bool optimizer_enable_sort;

src/include/utils/unsync_guc_name.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,6 @@
424424
"optimizer_enable_materialize",
425425
"optimizer_enable_mergejoin",
426426
"optimizer_enable_motion_broadcast",
427-
"parallel_hash_enable_motion_broadcast",
428427
"optimizer_enable_motion_gather",
429428
"optimizer_enable_motion_redistribute",
430429
"optimizer_enable_motions",

0 commit comments

Comments
 (0)