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

Commitc9ce4a1

Browse files
committed
Eliminate "parallel degree" terminology.
This terminology provoked widespread complaints. So, instead, renamethe GUC max_parallel_degree to max_parallel_workers_per_gather(leaving room for a possible future GUC max_parallel_workers that actsas a system-wide limit), and rename the parallel_degree reloption toparallel_workers. Rename structure members to match.These changes create a dump/restore hazard for users of PostgreSQL9.6beta1 who have set the reloption (or applied the GUC using ALTERUSER or ALTER DATABASE).
1 parent6581e93 commitc9ce4a1

File tree

19 files changed

+99
-99
lines changed

19 files changed

+99
-99
lines changed

‎doc/src/sgml/config.sgml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1998,16 +1998,16 @@ include_dir 'conf.d'
19981998
</listitem>
19991999
</varlistentry>
20002000

2001-
<varlistentry id="guc-max-parallel-degree" xreflabel="max_parallel_degree">
2002-
<term><varname>max_parallel_degree</varname> (<type>integer</type>)
2001+
<varlistentry id="guc-max-parallel-workers-per-gather" xreflabel="max_parallel_workers_per_gather">
2002+
<term><varname>max_parallel_workers_per_gather</varname> (<type>integer</type>)
20032003
<indexterm>
2004-
<primary><varname>max_parallel_degree</> configuration parameter</primary>
2004+
<primary><varname>max_parallel_workers_per_gather</> configuration parameter</primary>
20052005
</indexterm>
20062006
</term>
20072007
<listitem>
20082008
<para>
2009-
Sets the maximum number of workers that can be startedfor an
2010-
individual parallel operation. Parallel workers are taken from the
2009+
Sets the maximum number of workers that can be startedby a single
2010+
<literal>Gather</literal> node. Parallel workers are taken from the
20112011
pool of processes established by
20122012
<xref linkend="guc-max-worker-processes">. Note that the requested
20132013
number of workers may not actually be available at runtime. If this

‎doc/src/sgml/ref/create_table.sgml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -909,14 +909,14 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI
909909
</varlistentry>
910910

911911
<varlistentry>
912-
<term><literal>parallel_degree</> (<type>integer</>)</term>
912+
<term><literal>parallel_workers</> (<type>integer</>)</term>
913913
<listitem>
914914
<para>
915-
The parallel degree for a table isthe number of workers that should
916-
be used to assist a parallelscan ofthat table. If not set, the
917-
system will determine a value basedon the relation size. The actual
918-
number of workers chosen by the plannermay be less, for example due to
919-
the setting of <xref linkend="guc-max-parallel-degree">.
915+
This setsthe number of workers that should be used to assist a parallel
916+
scan ofthis table. If not set, the system will determine a value based
917+
on the relation size. The actual number of workers chosen by the planner
918+
may be less, for example due to
919+
the setting of <xref linkend="guc-max-worker-processes">.
920920
</para>
921921
</listitem>
922922
</varlistentry>

‎doc/src/sgml/release-9.6.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
<para>
154154
Use of parallel query execution can be controlled through the new
155155
configuration parameters
156-
<xref linkend="guc-max-parallel-degree">,
156+
<xref linkend="guc-max-parallel-workers-per-gather">,
157157
<xref linkend="guc-force-parallel-mode">,
158158
<xref linkend="guc-parallel-setup-cost">, and
159159
<xref linkend="guc-parallel-tuple-cost">.

‎src/backend/access/common/reloptions.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ static relopt_int intRelOpts[] =
270270
},
271271
{
272272
{
273-
"parallel_degree",
273+
"parallel_workers",
274274
"Number of parallel processes that can be used per executor node for this relation.",
275275
RELOPT_KIND_HEAP,
276276
AccessExclusiveLock
@@ -1301,8 +1301,8 @@ default_reloptions(Datum reloptions, bool validate, relopt_kind kind)
13011301
offsetof(StdRdOptions,autovacuum)+offsetof(AutoVacOpts,analyze_scale_factor)},
13021302
{"user_catalog_table",RELOPT_TYPE_BOOL,
13031303
offsetof(StdRdOptions,user_catalog_table)},
1304-
{"parallel_degree",RELOPT_TYPE_INT,
1305-
offsetof(StdRdOptions,parallel_degree)}
1304+
{"parallel_workers",RELOPT_TYPE_INT,
1305+
offsetof(StdRdOptions,parallel_workers)}
13061306
};
13071307

13081308
options=parseRelOptions(reloptions,validate,kind,&numoptions);

‎src/backend/nodes/outfuncs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1609,7 +1609,7 @@ _outPathInfo(StringInfo str, const Path *node)
16091609
_outBitmapset(str,NULL);
16101610
WRITE_BOOL_FIELD(parallel_aware);
16111611
WRITE_BOOL_FIELD(parallel_safe);
1612-
WRITE_INT_FIELD(parallel_degree);
1612+
WRITE_INT_FIELD(parallel_workers);
16131613
WRITE_FLOAT_FIELD(rows,"%.0f");
16141614
WRITE_FLOAT_FIELD(startup_cost,"%.2f");
16151615
WRITE_FLOAT_FIELD(total_cost,"%.2f");

‎src/backend/optimizer/path/allpaths.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -669,26 +669,26 @@ set_plain_rel_pathlist(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte)
669669
staticvoid
670670
create_plain_partial_paths(PlannerInfo*root,RelOptInfo*rel)
671671
{
672-
intparallel_degree=1;
672+
intparallel_workers=1;
673673

674674
/*
675-
* If the user has set theparallel_degree reloption, we decide what to do
675+
* If the user has set theparallel_workers reloption, we decide what to do
676676
* based on the value of that option. Otherwise, we estimate a value.
677677
*/
678-
if (rel->rel_parallel_degree!=-1)
678+
if (rel->rel_parallel_workers!=-1)
679679
{
680680
/*
681-
* Ifparallel_degree = 0 is set for this relation, bail out. The
681+
* Ifparallel_workers = 0 is set for this relation, bail out. The
682682
* user does not want a parallel path for this relation.
683683
*/
684-
if (rel->rel_parallel_degree==0)
684+
if (rel->rel_parallel_workers==0)
685685
return;
686686

687687
/*
688-
* Use the tableparallel_degree, but don't go further than
689-
*max_parallel_degree.
688+
* Use the tableparallel_workers, but don't go further than
689+
*max_parallel_workers_per_gather.
690690
*/
691-
parallel_degree=Min(rel->rel_parallel_degree,max_parallel_degree);
691+
parallel_workers=Min(rel->rel_parallel_workers,max_parallel_workers_per_gather);
692692
}
693693
else
694694
{
@@ -711,17 +711,17 @@ create_plain_partial_paths(PlannerInfo *root, RelOptInfo *rel)
711711
* sophisticated, but we need something here for now.
712712
*/
713713
while (rel->pages>parallel_threshold*3&&
714-
parallel_degree<max_parallel_degree)
714+
parallel_workers<max_parallel_workers_per_gather)
715715
{
716-
parallel_degree++;
716+
parallel_workers++;
717717
parallel_threshold *=3;
718718
if (parallel_threshold >=PG_INT32_MAX /3)
719719
break;
720720
}
721721
}
722722

723723
/* Add an unordered partial path based on a parallel sequential scan. */
724-
add_partial_path(rel,create_seqscan_path(root,rel,NULL,parallel_degree));
724+
add_partial_path(rel,create_seqscan_path(root,rel,NULL,parallel_workers));
725725
}
726726

727727
/*
@@ -1242,25 +1242,25 @@ set_append_rel_pathlist(PlannerInfo *root, RelOptInfo *rel,
12421242
{
12431243
AppendPath*appendpath;
12441244
ListCell*lc;
1245-
intparallel_degree=0;
1245+
intparallel_workers=0;
12461246

12471247
/*
1248-
* Decidewhat parallel degree to request for this append path. For
1249-
* now, we just use the maximumparallel degree of any member. It
1248+
* Decideon the numebr of workers to request for this append path. For
1249+
* now, we just use the maximumvalue from among the members. It
12501250
* might be useful to use a higher number if the Append node were
12511251
* smart enough to spread out the workers, but it currently isn't.
12521252
*/
12531253
foreach(lc,partial_subpaths)
12541254
{
12551255
Path*path=lfirst(lc);
12561256

1257-
parallel_degree=Max(parallel_degree,path->parallel_degree);
1257+
parallel_workers=Max(parallel_workers,path->parallel_workers);
12581258
}
1259-
Assert(parallel_degree>0);
1259+
Assert(parallel_workers>0);
12601260

12611261
/* Generate a partial append path. */
12621262
appendpath=create_append_path(rel,partial_subpaths,NULL,
1263-
parallel_degree);
1263+
parallel_workers);
12641264
add_partial_path(rel, (Path*)appendpath);
12651265
}
12661266

‎src/backend/optimizer/path/costsize.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ inteffective_cache_size = DEFAULT_EFFECTIVE_CACHE_SIZE;
113113

114114
Costdisable_cost=1.0e10;
115115

116-
intmax_parallel_degree=2;
116+
intmax_parallel_workers_per_gather=2;
117117

118118
boolenable_seqscan= true;
119119
boolenable_indexscan= true;
@@ -229,9 +229,9 @@ cost_seqscan(Path *path, PlannerInfo *root,
229229
cpu_run_cost+=path->pathtarget->cost.per_tuple*path->rows;
230230

231231
/* Adjust costing for parallelism, if used. */
232-
if (path->parallel_degree>0)
232+
if (path->parallel_workers>0)
233233
{
234-
doubleparallel_divisor=path->parallel_degree;
234+
doubleparallel_divisor=path->parallel_workers;
235235
doubleleader_contribution;
236236

237237
/*
@@ -245,7 +245,7 @@ cost_seqscan(Path *path, PlannerInfo *root,
245245
* estimate that the leader spends 30% of its time servicing each
246246
* worker, and the remainder executing the parallel plan.
247247
*/
248-
leader_contribution=1.0- (0.3*path->parallel_degree);
248+
leader_contribution=1.0- (0.3*path->parallel_workers);
249249
if (leader_contribution>0)
250250
parallel_divisor+=leader_contribution;
251251

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,7 @@ create_gather_plan(PlannerInfo *root, GatherPath *best_path)
13941394

13951395
gather_plan=make_gather(tlist,
13961396
NIL,
1397-
best_path->path.parallel_degree,
1397+
best_path->path.parallel_workers,
13981398
best_path->single_copy,
13991399
subplan);
14001400

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ standard_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
245245
glob->parallelModeOK= (cursorOptions&CURSOR_OPT_PARALLEL_OK)!=0&&
246246
IsUnderPostmaster&&dynamic_shared_memory_type!=DSM_IMPL_NONE&&
247247
parse->commandType==CMD_SELECT&& !parse->hasModifyingCTE&&
248-
parse->utilityStmt==NULL&&max_parallel_degree>0&&
248+
parse->utilityStmt==NULL&&max_parallel_workers_per_gather>0&&
249249
!IsParallelWorker()&& !IsolationIsSerializable()&&
250250
!has_parallel_hazard((Node*)parse, true);
251251

@@ -3622,7 +3622,7 @@ create_grouping_paths(PlannerInfo *root,
36223622
if (grouped_rel->partial_pathlist)
36233623
{
36243624
Path*path= (Path*)linitial(grouped_rel->partial_pathlist);
3625-
doubletotal_groups=path->rows*path->parallel_degree;
3625+
doubletotal_groups=path->rows*path->parallel_workers;
36263626

36273627
path= (Path*)create_gather_path(root,
36283628
grouped_rel,
@@ -3717,7 +3717,7 @@ create_grouping_paths(PlannerInfo *root,
37173717

37183718
if (hashaggtablesize<work_mem*1024L)
37193719
{
3720-
doubletotal_groups=path->rows*path->parallel_degree;
3720+
doubletotal_groups=path->rows*path->parallel_workers;
37213721

37223722
path= (Path*)create_gather_path(root,
37233723
grouped_rel,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp