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

Commit5702277

Browse files
committed
Tweak EXPLAIN for parallel query to show workers launched.
The previous display was sort of confusing, because it didn'tdistinguish between the number of workers that we planned to launchand the number that actually got launched. This has already confusedseveral people, so display both numbers and label them clearly.Julien Rouhaud, reviewed by me.
1 parent6b85d4b commit5702277

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

‎src/backend/commands/explain.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1339,8 +1339,16 @@ ExplainNode(PlanState *planstate, List *ancestors,
13391339
if (plan->qual)
13401340
show_instrumentation_count("Rows Removed by Filter",1,
13411341
planstate,es);
1342-
ExplainPropertyInteger("Number ofWorkers",
1342+
ExplainPropertyInteger("Workers Planned",
13431343
gather->num_workers,es);
1344+
if (es->analyze)
1345+
{
1346+
intnworkers;
1347+
1348+
nworkers= ((GatherState*)planstate)->nworkers_launched;
1349+
ExplainPropertyInteger("Workers Launched",
1350+
nworkers,es);
1351+
}
13441352
if (gather->single_copy)
13451353
ExplainPropertyText("Single Copy",
13461354
gather->single_copy ?"true" :"false",

‎src/backend/executor/nodeGather.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ ExecGather(GatherState *node)
166166
*/
167167
pcxt=node->pei->pcxt;
168168
LaunchParallelWorkers(pcxt);
169+
node->nworkers_launched=pcxt->nworkers_launched;
169170

170171
/* Set up tuple queue readers to read the results. */
171172
if (pcxt->nworkers_launched>0)

‎src/include/nodes/execnodes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1956,6 +1956,7 @@ typedef struct GatherState
19561956
structParallelExecutorInfo*pei;
19571957
intnreaders;
19581958
intnextreader;
1959+
intnworkers_launched;
19591960
structTupleQueueReader**reader;
19601961
TupleTableSlot*funnel_slot;
19611962
boolneed_to_scan_locally;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp