From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@postgresql.org
Subject: pgsql: Use more efficient hashtable for execGrouping.c to speed up hash
Date: Sat, 15 Oct 2016 00:28:12 +0000
Message-ID: <E1bvCpg-0003Od-7b@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
Use more efficient hashtable for execGrouping.c to speed up hash aggregation.
The more efficient hashtable speeds up hash-aggregations with more than
a few hundred groups significantly. Improvements of over 120% have been
measured.
Due to the the different hash table queries that not fully
determined (e.g. GROUP BY without ORDER BY) may change their result
order.
The conversion is largely straight-forward, except that, due to the
static element types of simplehash.h type hashes, the additional data
some users store in elements (e.g. the per-group working data for hash
aggregaters) is now stored in TupleHashEntryData->additional. The
meaning of BuildTupleHashTable's entrysize (renamed to additionalsize)
has been changed to only be about the additionally stored size. That
size is only used for the initial sizing of the hash-table.
Reviewed-By: Tomas Vondra
Discussion: <20160727004333.r3e2k2y6fvk2ntup@alap3.anarazel.de>
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/5dfc198146b49ce7ecc8a1fc9d5e171fb75f6ba5
Modified Files
--------------
src/backend/executor/execGrouping.c | 155 ++++++++++++------------------
src/backend/executor/nodeAgg.c | 64 ++++++------
src/backend/executor/nodeRecursiveunion.c | 17 +---
src/backend/executor/nodeSetOp.c | 46 ++++-----
src/backend/executor/nodeSubplan.c | 6 +-
src/backend/optimizer/plan/planner.c | 6 ++
src/include/executor/executor.h | 2 +-
src/include/nodes/execnodes.h | 32 +++---
src/tools/pgindent/typedefs.list | 2 +
9 files changed, 144 insertions(+), 186 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
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: Use more efficient hashtable for execGrouping.c to speed up hash
In-Reply-To: <E1bvCpg-0003Od-7b@gemulon.postgresql.org>
References: <E1bvCpg-0003Od-7b@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