pgsql: Perform one only projection to compute agg arguments.

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Perform one only projection to compute agg arguments.
Date: 2016-12-01 00:22:08
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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/[email protected]

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/8ed3f11bb045ad7a3607690be668dbd5b3cc31d7

Modified Files
--------------
src/backend/executor/nodeAgg.c | 167 ++++++++++++++++++++++++++++-------------
src/include/nodes/execnodes.h | 4 +
2 files changed, 119 insertions(+), 52 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2016-12-01 01:50:05 pgsql: User narrower representative tuples in the hash-agg hashtable.
Previous Message Michael Paquier 2016-11-30 21:07:16 Re: pgsql: Add putenv support for msvcrt from Visual Studio 2013