pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@postgresql.org
Subject: pgsql: Simplify representation of aggregate transition values a bit.
Date: Wed, 03 Jan 2018 03:12:55 +0000
Message-ID: <E1eWZU7-0002RQ-Rv@gemulon.postgresql.org> (raw)

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(-)



Message-ID: <E1eWZU7-0002RQ-Rv@gemulon.postgresql.org>
Permalink:  ../E1eWZU7-0002RQ-Rv@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1eWZU7-0002RQ-Rv@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de
  Subject: Re: pgsql: Simplify representation of aggregate transition values a bit.
  In-Reply-To: <E1eWZU7-0002RQ-Rv@gemulon.postgresql.org>
  References: <E1eWZU7-0002RQ-Rv@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox