Basic planner and executor integration for JIT.
Andres Freund <andres@anarazel.de>
Basic planner and executor integration for JIT. This adds simple cost based plan time decision about whether JIT should be performed. jit_above_cost, jit_optimize_above_cost are compared with the total cost of a plan, and if the cost is above them JIT is performed / optimization is performed respectively. For that PlannedStmt and EState have a jitFlags (es_jit_flags) field that stores information about what JIT operations should be performed. EState now also has a new es_jit field, which can store a JitContext. When there are no errors the context is released in standard_ExecutorEnd(). It is likely that the default values for jit_[optimize_]above_cost will need to be adapted further, but in my test these values seem to work reasonably. Author: Andres Freund, with feedback by Peter Eisentraut Discussion: https://postgr.es/m/20170901064131.tazjxwus3k2w3ybh@alap3.anarazel.de
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/executor/execMain.c | modified | +8 −0 |
| src/backend/executor/execParallel.c | modified | +3 −0 |
| src/backend/executor/execUtils.c | modified | +3 −0 |
| src/backend/jit/jit.c | modified | +2 −0 |
| src/backend/nodes/copyfuncs.c | modified | +1 −0 |
| src/backend/nodes/outfuncs.c | modified | +1 −0 |
| src/backend/nodes/readfuncs.c | modified | +1 −0 |
| src/backend/optimizer/plan/planner.c | modified | +15 −0 |
| src/backend/utils/misc/guc.c | modified | +20 −0 |
| src/backend/utils/misc/postgresql.conf.sample | modified | +6 −0 |
| src/include/jit/jit.h | modified | +2 −0 |
| src/include/nodes/execnodes.h | modified | +8 −0 |
| src/include/nodes/plannodes.h | modified | +2 −0 |
Discussion
- JIT compiling expressions/deform + inlining prototype v2.0 271 messages · 2017-09-01 → 2018-09-06