Add optional JIT support for expression evaluation.

Started by Andres Freundover 9 years ago2 messagescomitters
Jump to latest
#1Andres Freund
andres@anarazel.de

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: /messages/by-id/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(-)

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#2Simon Riggs
simon@2ndQuadrant.com
In reply to: Andres Freund (#1)
Re: Add optional JIT support for expression evaluation.

On 1 April 2017 at 08:41, Andres Freund <andres@anarazel.de> wrote:

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

+1

--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers