mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
Add parallel_leader_participation GUC.
Sometimes, for testing, it's useful to have the leader do nothing but read tuples from workers; and it's possible that could work out better even in production. Thomas Munro, reviewed by Amit Kapila and by me. A few final tweaks by me. Discussion: http://postgr.es/m/CAEepm=2U++Lp3bNTv2Bv_kkr5NE2pOyHhxU=G0YTa4ZhSYhHiw@mail.gmail.com
This commit is contained in:
@ -5137,7 +5137,6 @@ static double
|
||||
get_parallel_divisor(Path *path)
|
||||
{
|
||||
double parallel_divisor = path->parallel_workers;
|
||||
double leader_contribution;
|
||||
|
||||
/*
|
||||
* Early experience with parallel query suggests that when there is only
|
||||
@ -5150,9 +5149,14 @@ get_parallel_divisor(Path *path)
|
||||
* its time servicing each worker, and the remainder executing the
|
||||
* parallel plan.
|
||||
*/
|
||||
leader_contribution = 1.0 - (0.3 * path->parallel_workers);
|
||||
if (leader_contribution > 0)
|
||||
parallel_divisor += leader_contribution;
|
||||
if (parallel_leader_participation)
|
||||
{
|
||||
double leader_contribution;
|
||||
|
||||
leader_contribution = 1.0 - (0.3 * path->parallel_workers);
|
||||
if (leader_contribution > 0)
|
||||
parallel_divisor += leader_contribution;
|
||||
}
|
||||
|
||||
return parallel_divisor;
|
||||
}
|
||||
|
Reference in New Issue
Block a user