diff options
author | Michael Paquier <michael@paquier.xyz> | 2024-10-09 08:07:48 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2024-10-09 08:07:48 +0900 |
commit | de3a2ea3b264a5625cda6d8968f75e9bfb4dbdcb (patch) | |
tree | 7ecddeaadc4fb0b8333043d6e440b5b50c33c16c /src/backend/executor/nodeGather.c | |
parent | 01fce8dab16385573ba0f2ddd3d52ba3514a6562 (diff) | |
download | postgresql-de3a2ea3b264a5625cda6d8968f75e9bfb4dbdcb.tar.gz postgresql-de3a2ea3b264a5625cda6d8968f75e9bfb4dbdcb.zip |
Introduce two fields in EState to track parallel worker activity
These fields can be set by executor nodes to record how many parallel
workers were planned to be launched and how many of them have been
actually launched within the number initially planned. This data is
able to give an approximation of the parallel worker draught a system
is facing, making easier the tuning of related configuration parameters.
These fields will be used by some follow-up patches to populate other
parts of the system with their data.
Author: Guillaume Lelarge, Benoit Lobréau
Discussion: https://postgr.es/m/783bc7f7-659a-42fa-99dd-ee0565644e25@dalibo.com
Discussion: https://postgr.es/m/CAECtzeWtTGOK0UgKXdDGpfTVSa5bd_VbUt6K6xn8P7X+_dZqKw@mail.gmail.com
Diffstat (limited to 'src/backend/executor/nodeGather.c')
-rw-r--r-- | src/backend/executor/nodeGather.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/backend/executor/nodeGather.c b/src/backend/executor/nodeGather.c index 5d4ffe989cb..7f7edc7f9fc 100644 --- a/src/backend/executor/nodeGather.c +++ b/src/backend/executor/nodeGather.c @@ -182,6 +182,13 @@ ExecGather(PlanState *pstate) /* We save # workers launched for the benefit of EXPLAIN */ node->nworkers_launched = pcxt->nworkers_launched; + /* + * Count number of workers originally wanted and actually + * launched. + */ + estate->es_parallel_workers_to_launch += pcxt->nworkers_to_launch; + estate->es_parallel_workers_launched += pcxt->nworkers_launched; + /* Set up tuple queue readers to read the results. */ if (pcxt->nworkers_launched > 0) { |