pgsql: Try again to fix accumulation of parallel worker instrumentation

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Try again to fix accumulation of parallel worker instrumentation
Date: 2017-12-19 17:48:10
Message-ID: E1eRLzu-0007n4-S6@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Try again to fix accumulation of parallel worker instrumentation.

When a Gather or Gather Merge node is started and stopped multiple
times, accumulate instrumentation data only once, at the end, instead
of after each execution, to avoid recording inflated totals.

Commit 778e78ae9fa51e58f41cbdc72b293291d02d8984, the previous attempt
at a fix, instead reset the state after every execution, which worked
for the general instrumentation data but had problems for the additional
instrumentation specific to Sort and Hash nodes.

Report by hubert depesz lubaczewski. Analysis and fix by Amit Kapila,
following a design proposal from Thomas Munro, with a comment tweak
by me.

Discussion: http://postgr.es/m/20171127175631.GA405@depesz.com

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/72567f6174605c36ba520c80e71697d2601cac0a

Modified Files
--------------
src/backend/executor/execParallel.c | 20 ++++++++++----------
src/test/regress/expected/select_parallel.out | 21 +++++++++++++++++++++
src/test/regress/sql/select_parallel.sql | 7 +++++++
3 files changed, 38 insertions(+), 10 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2017-12-19 20:30:05 pgsql: Test instrumentation of Hash nodes with parallel query.
Previous Message Robert Haas 2017-12-19 15:45:23 pgsql: Re-fix wrong costing of Sort under Gather Merge.