pgsql: Simplify representation of aggregate transition values a bit.

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Simplify representation of aggregate transition values a bit.
Date: 2018-01-03 03:12:55
Message-ID: E1eWZU7-0002RQ-Rv@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Simplify representation of aggregate transition values a bit.

Previously aggregate transition values for hash and other forms of
aggregation (i.e. sort and no group by) were represented
differently. Hash based aggregation used a grouping set indexed array
pointing to an array of transition values, whereas other forms of
aggregation used one flattened array with the index being computed out
of grouping set and transition offsets.

That made upcoming changes hard, so represent both as grouping set
indexed array of per-group data.

As a nice side-effect this also makes aggregation slightly faster,
because computing offsets with `transno + (setno * numTrans)` turns
out not to be that cheap (too big for x86 lea for example).

Author: Andres Freund
Discussion: https://postgr.es/m/20171128003121.nmxbm2ounxzb6n2t@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f9ccf92e16fc4d831d324c7f7ef347a0acdaef0a

Modified Files
--------------
src/backend/executor/nodeAgg.c | 110 +++++++++++++++++++++++------------------
src/include/nodes/execnodes.h | 6 ++-
2 files changed, 65 insertions(+), 51 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2018-01-03 03:44:45 Re: pgsql: Fix deadlock hazard in CREATE INDEX CONCURRENTLY
Previous Message Tom Lane 2018-01-03 02:23:22 pgsql: Ensure proper alignment of tuples in HashMemoryChunkData buffers