pgsql: Unbreak Finalize HashAggregate over Partial HashAggregate.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Unbreak Finalize HashAggregate over Partial HashAggregate.
Date: 2016-12-16 15:11:13
Message-ID: E1cHuAD-0005am-IG@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Unbreak Finalize HashAggregate over Partial HashAggregate.

Commit 5dfc198146b49ce7ecc8a1fc9d5e171fb75f6ba5 introduced the use
of a new type of hash table with linear reprobing for hash aggregates.
Such a hash table behaves very poorly if keys are inserted in hash
order, which does in fact happen in the case where a query use a
Finalize HashAggregate node fed (via Gather) by a Partial
HashAggregate node. In fact, queries with this type of plan tend
to run effectively forever.

Fix that by seeding the hash value differently in each worker
(and in the leader, if it participates).

Andres Freund and Robert Haas

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/b81b5a96f424531b97cdd1dba97d9d1b9c9d372e

Modified Files
--------------
src/backend/executor/execGrouping.c | 20 ++++++++++++++++++--
src/backend/executor/nodeAgg.c | 3 ++-
src/backend/executor/nodeRecursiveunion.c | 3 ++-
src/backend/executor/nodeSetOp.c | 3 ++-
src/backend/executor/nodeSubplan.c | 6 ++++--
src/include/executor/executor.h | 2 +-
src/include/nodes/execnodes.h | 1 +
7 files changed, 30 insertions(+), 8 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2016-12-16 16:27:13 pgsql: Add missing documentation for effective_io_concurrency tablespac
Previous Message Robert Haas 2016-12-16 14:58:46 pgsql: Fix more hash index bugs around marking buffers dirty.