summaryrefslogtreecommitdiff
path: root/src/include/executor/nodeAgg.h
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2018-02-15 21:55:31 -0800
committerAndres Freund <andres@anarazel.de>2018-02-15 21:55:31 -0800
commit773aec7aa98abd38d6d9435913bb8e14e392c274 (patch)
tree149ffe4c29433a85e84e128eb47aa22f3b388853 /src/include/executor/nodeAgg.h
parent51db0d18fbf58b0c2e5ebc2b5b2c48daf45c8d93 (diff)
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: https://postgr.es/m/20171129080934.amqqkke2zjtekd4t@alap3.anarazel.de
Diffstat (limited to 'src/include/executor/nodeAgg.h')
-rw-r--r--src/include/executor/nodeAgg.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/include/executor/nodeAgg.h b/src/include/executor/nodeAgg.h
index 3b06db86fd8..24be7d2daa8 100644
--- a/src/include/executor/nodeAgg.h
+++ b/src/include/executor/nodeAgg.h
@@ -102,11 +102,12 @@ typedef struct AggStatePerTransData
bool *sortNullsFirst;
/*
- * fmgr lookup data for input columns' equality operators --- only
- * set/used when aggregate has DISTINCT flag. Note that these are in
- * order of sort column index, not parameter index.
+ * Comparators for input columns --- only set/used when aggregate has
+ * DISTINCT flag. equalfnOne version is used for single-column
+ * commparisons, equalfnMulti for the case of multiple columns.
*/
- FmgrInfo *equalfns; /* array of length numDistinctCols */
+ FmgrInfo equalfnOne;
+ ExprState *equalfnMulti;
/*
* initial value from pg_aggregate entry
@@ -270,7 +271,8 @@ typedef struct AggStatePerPhaseData
int numsets; /* number of grouping sets (or 0) */
int *gset_lengths; /* lengths of grouping sets */
Bitmapset **grouped_cols; /* column groupings for rollup */
- FmgrInfo *eqfunctions; /* per-grouping-field equality fns */
+ ExprState **eqfunctions; /* expression returning equality, indexed by
+ * nr of cols to compare */
Agg *aggnode; /* Agg node for phase data */
Sort *sortnode; /* Sort node for input ordering for phase */