pgsql: Do execGrouping.c via expression eval machinery.

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

Do execGrouping.c via expression eval machinery.

This has a performance benefit on own, although not hugely so. The
primary benefit is that it will allow for to JIT tuple deforming and
comparator invocations.

Author: Andres Freund
Discussion: /messages/by-id/20171129080934.amqqkke2zjtekd4t@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/773aec7aa98abd38d6d9435913bb8e14e392c274

Modified Files
--------------
src/backend/executor/execExpr.c | 118 +++++++++++++++
src/backend/executor/execExprInterp.c | 29 ++++
src/backend/executor/execGrouping.c | 236 +++++++-----------------------
src/backend/executor/nodeAgg.c | 143 +++++++++++-------
src/backend/executor/nodeGroup.c | 24 +--
src/backend/executor/nodeRecursiveunion.c | 5 +-
src/backend/executor/nodeSetOp.c | 48 +++---
src/backend/executor/nodeSubplan.c | 81 +++++++++-
src/backend/executor/nodeUnique.c | 31 ++--
src/backend/executor/nodeWindowAgg.c | 38 +++--
src/backend/utils/adt/orderedsetaggs.c | 56 +++----
src/include/executor/execExpr.h | 1 +
src/include/executor/executor.h | 28 ++--
src/include/executor/nodeAgg.h | 12 +-
src/include/nodes/execnodes.h | 14 +-
15 files changed, 498 insertions(+), 366 deletions(-)

#2Andres Freund
andres@anarazel.de
In reply to: Andres Freund (#1)
Re: pgsql: Do execGrouping.c via expression eval machinery.

On 2018-02-16 05:58:09 +0000, Andres Freund wrote:

Do execGrouping.c via expression eval machinery.

This has a performance benefit on own, although not hugely so. The
primary benefit is that it will allow for to JIT tuple deforming and
comparator invocations.

Author: Andres Freund
Discussion: /messages/by-id/20171129080934.amqqkke2zjtekd4t@alap3.anarazel.de

Triggered a failure on termite:
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=termite&dt=2018-02-16%2006%3A00%3A06
investigating. If I can't figure this out by tomorrow PST morning, I'll
revert.

Greetings,

Andres Freund

#3Andres Freund
andres@anarazel.de
In reply to: Andres Freund (#2)
Re: pgsql: Do execGrouping.c via expression eval machinery.

On 2018-02-15 22:14:30 -0800, Andres Freund wrote:

On 2018-02-16 05:58:09 +0000, Andres Freund wrote:

Do execGrouping.c via expression eval machinery.

This has a performance benefit on own, although not hugely so. The
primary benefit is that it will allow for to JIT tuple deforming and
comparator invocations.

Author: Andres Freund
Discussion: /messages/by-id/20171129080934.amqqkke2zjtekd4t@alap3.anarazel.de

Triggered a failure on termite:
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=termite&dt=2018-02-16%2006%3A00%3A06
investigating. If I can't figure this out by tomorrow PST morning, I'll
revert.

I've analyzed the problem - the cross type case isn't quite right
(i.e. the FindTupleHashEntry call in nodeSubplan.c). Unfortunately we do
not exercise that code in a meaningful manner on a 64 bit system, as
int4 vs int8 is nearly invisible there... Reverting as writing a fix
and developing appropriate coverage will take a couple hours.

Greetings,

Andres Freund