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

Commitde3a2ea

Browse files
committed
Introduce two fields in EState to track parallel worker activity
These fields can be set by executor nodes to record how many parallelworkers were planned to be launched and how many of them have beenactually launched within the number initially planned. This data isable to give an approximation of the parallel worker draught a systemis facing, making easier the tuning of related configuration parameters.These fields will be used by some follow-up patches to populate otherparts of the system with their data.Author: Guillaume Lelarge, Benoit LobréauDiscussion:https://postgr.es/m/783bc7f7-659a-42fa-99dd-ee0565644e25@dalibo.comDiscussion:https://postgr.es/m/CAECtzeWtTGOK0UgKXdDGpfTVSa5bd_VbUt6K6xn8P7X+_dZqKw@mail.gmail.com
1 parent01fce8d commitde3a2ea

File tree

4 files changed

+21
-0
lines changed

4 files changed

+21
-0
lines changed

‎src/backend/executor/execUtils.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ CreateExecutorState(void)
158158
estate->es_sourceText=NULL;
159159

160160
estate->es_use_parallel_mode= false;
161+
estate->es_parallel_workers_to_launch=0;
162+
estate->es_parallel_workers_launched=0;
161163

162164
estate->es_jit_flags=0;
163165
estate->es_jit=NULL;

‎src/backend/executor/nodeGather.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,13 @@ ExecGather(PlanState *pstate)
182182
/* We save # workers launched for the benefit of EXPLAIN */
183183
node->nworkers_launched=pcxt->nworkers_launched;
184184

185+
/*
186+
* Count number of workers originally wanted and actually
187+
* launched.
188+
*/
189+
estate->es_parallel_workers_to_launch+=pcxt->nworkers_to_launch;
190+
estate->es_parallel_workers_launched+=pcxt->nworkers_launched;
191+
185192
/* Set up tuple queue readers to read the results. */
186193
if (pcxt->nworkers_launched>0)
187194
{

‎src/backend/executor/nodeGatherMerge.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,13 @@ ExecGatherMerge(PlanState *pstate)
223223
/* We save # workers launched for the benefit of EXPLAIN */
224224
node->nworkers_launched=pcxt->nworkers_launched;
225225

226+
/*
227+
* Count number of workers originally wanted and actually
228+
* launched.
229+
*/
230+
estate->es_parallel_workers_to_launch+=pcxt->nworkers_to_launch;
231+
estate->es_parallel_workers_launched+=pcxt->nworkers_launched;
232+
226233
/* Set up tuple queue readers to read the results. */
227234
if (pcxt->nworkers_launched>0)
228235
{

‎src/include/nodes/execnodes.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,11 @@ typedef struct EState
708708

709709
booles_use_parallel_mode;/* can we use parallel workers? */
710710

711+
intes_parallel_workers_to_launch;/* number of workers to
712+
* launch. */
713+
intes_parallel_workers_launched;/* number of workers actually
714+
* launched. */
715+
711716
/* The per-query shared memory area to use for parallel execution. */
712717
structdsa_area*es_query_dsa;
713718

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp