Skip to content

Commit 64a5d33

Browse files
committed
Fix force_parallel_mode to work as intended.
The force_parallel_mode GUC is meant to facilitate testing of parallel query plans, but it currently allows non-parallel plans to win even when force_parallel_mode is enabled. This behavior makes it difficult to debug parallel plans as intended. Correct the behavior for testing purposes. Authored-by: Zhang Mingli [email protected]
1 parent 793971e commit 64a5d33

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/backend/optimizer/plan/planner.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,8 @@ standard_planner(Query *parse, const char *query_string, int cursorOptions,
593593
{
594594
Path *cheapest_partial_path;
595595
cheapest_partial_path = linitial(final_rel->partial_pathlist);
596+
if (force_parallel_mode)
597+
final_rel->pathlist = NIL;
596598
add_path(final_rel, cheapest_partial_path, root);
597599
set_cheapest(final_rel);
598600
}

0 commit comments

Comments
 (0)