aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execParallel.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2016-03-04 12:59:10 -0500
committerRobert Haas <rhaas@postgresql.org>2016-03-04 12:59:10 -0500
commitdf4685fb0cad1c75970b6e8d0aacca4d03545e04 (patch)
tree88691c5fd5004e2099bd2d0725fe7143cd7aa2ca /src/backend/executor/execParallel.c
parent546cd0d7664ee0f120ef3b267d4303190bdfdb94 (diff)
downloadpostgresql-df4685fb0cad1c75970b6e8d0aacca4d03545e04.tar.gz
postgresql-df4685fb0cad1c75970b6e8d0aacca4d03545e04.zip
Minor optimizations based on ParallelContext having nworkers_launched.
Originally, we didn't have nworkers_launched, so code that used parallel contexts had to be preprared for the possibility that not all of the workers requested actually got launched. But now we can count on knowing the number of workers that were successfully launched, which can shave off a few cycles and simplify some code slightly. Amit Kapila, reviewed by Haribabu Kommi, per a suggestion from Peter Geoghegan.
Diffstat (limited to 'src/backend/executor/execParallel.c')
-rw-r--r--src/backend/executor/execParallel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/executor/execParallel.c b/src/backend/executor/execParallel.c
index 95e8e41d2bb..93c786abdbe 100644
--- a/src/backend/executor/execParallel.c
+++ b/src/backend/executor/execParallel.c
@@ -522,7 +522,7 @@ ExecParallelFinish(ParallelExecutorInfo *pei)
WaitForParallelWorkersToFinish(pei->pcxt);
/* Next, accumulate buffer usage. */
- for (i = 0; i < pei->pcxt->nworkers; ++i)
+ for (i = 0; i < pei->pcxt->nworkers_launched; ++i)
InstrAccumParallelQuery(&pei->buffer_usage[i]);
/* Finally, accumulate instrumentation, if any. */