Add optional JIT support for expression evaluation.

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)postgresql(dot)org
Subject: Add optional JIT support for expression evaluation.
Date: 2017-04-01 07:41:41
Message-ID: 20170401074141.jgzageyn3fzshdf3@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Based on the infrastructure added in b8d7f053c5c2b, this allows
expressions in expensive queries to be compiled to native code. In
TPC-H this yields up to 40% of speedups.

Whenever a query has a total cost over jit_expression_minimum, all
expressions in it will be JIT compiled. That allows to perform JIT
compilation of all expressions in one go, which is a lot more
efficient.

Originally slated for v11, discussions at pgconf.us convinced me to
add this to v10.

Author: Andres Freund
Reviewed-By: Robert Haas, Heikki Linnakangas
Discussion: http://postgr.es/m/20161206034955.bh33paeralxbtluv@alap3.anarazel.de

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/d31084e9d1118b25fd16580d9d8c2924b5740dff

Modified Files
--------------
configure | 109 ++
configure.in | 37 +
src/Makefile.global.in | 12 +
src/backend/Makefile | 8 +
src/backend/access/common/heaptuple.c | 1438 +++++++++++++++--
src/backend/access/common/tupdesc.c | 6 +
src/backend/executor/Makefile | 6 +-
src/backend/executor/execExprCompile.c | 2724 ++++++++++++++++++++++++++++++++
src/backend/executor/execExpr.c | 271 +++-
src/backend/executor/execExprInterp.c | 202 ++-
src/backend/executor/execMain.c | 5 +
src/backend/executor/execTuples.c | 32 +
src/backend/executor/nodeAgg.c | 393 ++---
src/backend/executor/nodeHash.c | 21 +-
src/backend/lib/Makefile | 5 +-
src/backend/lib/llvmjit.c | 324 ++++
src/backend/lib/llvmjit_profile.cpp | 33 +
src/backend/utils/misc/guc.c | 50 +
src/backend/utils/resowner/resowner.c | 32 +
src/include/access/tupdesc.h | 8 +
src/include/executor/execExpr.h | 55 +-
src/include/executor/executor.h | 7 +-
src/include/executor/hashjoin.h | 2 +
src/include/executor/nodeAgg.h | 273 ++++
src/include/executor/tuptable.h | 7 +-
src/include/lib/llvmjit.h | 45 +
src/include/nodes/execnodes.h | 8 +-
src/include/pg_config.h.in | 3 +
src/include/utils/resowner_private.h | 7 +
29 files changed, 5689 insertions(+), 434 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Thomas Munro 2017-04-01 08:27:42 Re: Vendor LLVM 4.0.
Previous Message Andres Freund 2017-04-01 07:41:38 Vendor LLVM 4.0.