1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-27 07:42:10 +03:00

Fix EXPLAIN ANALYZE output for Parallel Hash.

In a race case, EXPLAIN ANALYZE could fail to display correct nbatch
and size information.  Refactor so that participants report only on
batches they worked on rather than trying to report on all of them,
and teach explain.c to consider the HashInstrumentation object from
all participants instead of picking the first one it can find.  This
should fix an occasional build farm failure in the "join" regression
test.

Author: Thomas Munro
Reviewed-By: Andres Freund
Discussion: https://postgr.es/m/30219.1514428346%40sss.pgh.pa.us
This commit is contained in:
Andres Freund
2018-01-01 14:38:23 -08:00
parent 6078770c1a
commit 93ea78b17c
4 changed files with 62 additions and 51 deletions

View File

@@ -1186,12 +1186,6 @@ ExecParallelHashJoinNewBatch(HashJoinState *hjstate)
* remain).
*/
BarrierDetach(batch_barrier);
/*
* We didn't work on this batch, but we need to observe
* its size for EXPLAIN.
*/
ExecParallelHashUpdateSpacePeak(hashtable, batchno);
hashtable->batches[batchno].done = true;
hashtable->curbatch = -1;
break;