diff options
author | Andres Freund <andres@anarazel.de> | 2016-11-30 16:08:11 -0800 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2016-11-30 16:20:24 -0800 |
commit | 8ed3f11bb045ad7a3607690be668dbd5b3cc31d7 (patch) | |
tree | 16c0129c785f7b3c19e078476df3371c5c225acf /src/include/nodes/execnodes.h | |
parent | 6d46f4783efe457f74816a75173eb23ed8930020 (diff) | |
download | postgresql-8ed3f11bb045ad7a3607690be668dbd5b3cc31d7.tar.gz postgresql-8ed3f11bb045ad7a3607690be668dbd5b3cc31d7.zip |
Perform one only projection to compute agg arguments.
Previously we did a ExecProject() for each individual aggregate
argument. That turned out to be a performance bottleneck in queries with
multiple aggregates.
Doing all the argument computations in one ExecProject() is quite a bit
cheaper because ExecProject's fastpath can do the work at once in a
relatively tight loop, and because it can get all the required columns
with a single slot_getsomeattr and save some other redundant setup
costs.
Author: Andres Freund
Reviewed-By: Heikki Linnakangas
Discussion: https://postgr.es/m/20161103110721.h5i5t5saxfk5eeik@alap3.anarazel.de
Diffstat (limited to 'src/include/nodes/execnodes.h')
-rw-r--r-- | src/include/nodes/execnodes.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index f6f73f3c590..f85b7ea5a7c 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -1863,6 +1863,10 @@ typedef struct AggState List *hash_needed; /* list of columns needed in hash table */ bool table_filled; /* hash table filled yet? */ TupleHashIterator hashiter; /* for iterating through hash table */ + /* support for evaluation of agg inputs */ + TupleTableSlot *evalslot; /* slot for agg inputs */ + ProjectionInfo *evalproj; /* projection machinery */ + TupleDesc evaldesc; /* descriptor of input tuples */ } AggState; /* ---------------- |