aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2018-10-03 12:48:37 -0700
committerAndres Freund <andres@anarazel.de>2018-10-03 12:48:37 -0700
commitc03c1449c0925637d382bd16197796e6c5cab31d (patch)
tree3501ee216b787fa81a20daa55a4c6f8f324c8bac /src/backend/executor
parent595a0eab7f425e3484639fae1f7e221fe9c2651a (diff)
downloadpostgresql-c03c1449c0925637d382bd16197796e6c5cab31d.tar.gz
postgresql-c03c1449c0925637d382bd16197796e6c5cab31d.zip
Fix issues around EXPLAIN with JIT.
I (Andres) was more than a bit hasty in committing 33001fd7a7072d48327 after last minute changes, leading to a number of problems (jit output was only shown for JIT in parallel workers, and just EXPLAIN without ANALYZE didn't work). Lukas luckily found these issues quickly. Instead of combining instrumentation in in standard_ExecutorEnd(), do so on demand in the new ExplainPrintJITSummary(). Also update a documentation example of the JIT output, changed in 52050ad8ebec8d831. Author: Lukas Fittl, with minor changes by me Discussion: https://postgr.es/m/CAP53PkxmgJht69pabxBXJBM+0oc6kf3KHMborLP7H2ouJ0CCtQ@mail.gmail.com Backpatch: 11, where JIT compilation was introduced
Diffstat (limited to 'src/backend/executor')
-rw-r--r--src/backend/executor/execMain.c15
-rw-r--r--src/backend/executor/execParallel.c9
2 files changed, 4 insertions, 20 deletions
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index c865032a80f..1e97ff5643f 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -495,21 +495,6 @@ standard_ExecutorEnd(QueryDesc *queryDesc)
ExecEndPlan(queryDesc->planstate, estate);
- /*
- * If this process has done JIT, either merge stats into worker stats, or
- * use this process' stats as the global stats if no parallelism was used
- * / no workers did JIT.
- */
- if (estate->es_instrument && queryDesc->estate->es_jit)
- {
- if (queryDesc->estate->es_jit_combined_instr)
- InstrJitAgg(queryDesc->estate->es_jit_combined_instr,
- &queryDesc->estate->es_jit->instr);
- else
- queryDesc->estate->es_jit_combined_instr =
- &queryDesc->estate->es_jit->instr;
- }
-
/* do away with our snapshots */
UnregisterSnapshot(estate->es_snapshot);
UnregisterSnapshot(estate->es_crosscheck_snapshot);
diff --git a/src/backend/executor/execParallel.c b/src/backend/executor/execParallel.c
index 7d8bd01994f..0fdbd119d9b 100644
--- a/src/backend/executor/execParallel.c
+++ b/src/backend/executor/execParallel.c
@@ -1043,13 +1043,12 @@ ExecParallelRetrieveJitInstrumentation(PlanState *planstate,
/*
* Accumulate worker JIT instrumentation into the combined JIT
- * instrumentation, allocating it if required. Note this is kept separate
- * from the leader's own instrumentation.
+ * instrumentation, allocating it if required.
*/
- if (!planstate->state->es_jit_combined_instr)
- planstate->state->es_jit_combined_instr =
+ if (!planstate->state->es_jit_worker_instr)
+ planstate->state->es_jit_worker_instr =
MemoryContextAllocZero(planstate->state->es_query_cxt, sizeof(JitInstrumentation));
- combined = planstate->state->es_jit_combined_instr;
+ combined = planstate->state->es_jit_worker_instr;
/* Accummulate all the workers' instrumentations. */
for (n = 0; n < shared_jit->num_workers; ++n)