]> granicus.if.org Git - postgresql/commit
Perform one only projection to compute agg arguments.
authorAndres Freund <andres@anarazel.de>
Thu, 1 Dec 2016 00:08:11 +0000 (16:08 -0800)
committerAndres Freund <andres@anarazel.de>
Thu, 1 Dec 2016 00:20:24 +0000 (16:20 -0800)
commit8ed3f11bb045ad7a3607690be668dbd5b3cc31d7
tree16c0129c785f7b3c19e078476df3371c5c225acf
parent6d46f4783efe457f74816a75173eb23ed8930020
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
src/backend/executor/nodeAgg.c
src/include/nodes/execnodes.h