Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0e495c5

Browse files
committed
Set correct cost data in Gather node added by force_parallel_mode.
We were just leaving the cost fields zeroes, which produces obviously bogusoutput with force_parallel_mode = on. With force_parallel_mode = regress,the zeroes are hidden, but I wonder if they wouldn't still confuse add-oncode such as auto_explain.
1 parentc89d507 commit0e495c5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

‎src/backend/optimizer/plan/planner.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,22 @@ standard_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
343343
gather->num_workers=1;
344344
gather->single_copy= true;
345345
gather->invisible= (force_parallel_mode==FORCE_PARALLEL_REGRESS);
346+
347+
/*
348+
* Ideally we'd use cost_gather here, but setting up dummy path data
349+
* to satisfy it doesn't seem much cleaner than knowing what it does.
350+
*/
351+
gather->plan.startup_cost=top_plan->startup_cost+
352+
parallel_setup_cost;
353+
gather->plan.total_cost=top_plan->total_cost+
354+
parallel_setup_cost+parallel_tuple_cost*top_plan->plan_rows;
355+
gather->plan.plan_rows=top_plan->plan_rows;
356+
gather->plan.plan_width=top_plan->plan_width;
357+
gather->plan.parallel_aware= false;
358+
359+
/* use parallel mode for parallel plans. */
346360
root->glob->parallelModeNeeded= true;
361+
347362
top_plan=&gather->plan;
348363
}
349364

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp