diff options
author | Robert Haas <rhaas@postgresql.org> | 2016-12-16 10:03:08 -0500 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2016-12-16 10:03:08 -0500 |
commit | b81b5a96f424531b97cdd1dba97d9d1b9c9d372e (patch) | |
tree | 9f2a42bcb7413185777dfae93163794838d47211 /src/backend/executor/nodeRecursiveunion.c | |
parent | 6a4fe1127c5a0ea1515589e416aa29e088170c0e (diff) | |
download | postgresql-b81b5a96f424531b97cdd1dba97d9d1b9c9d372e.tar.gz postgresql-b81b5a96f424531b97cdd1dba97d9d1b9c9d372e.zip |
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
Diffstat (limited to 'src/backend/executor/nodeRecursiveunion.c')
-rw-r--r-- | src/backend/executor/nodeRecursiveunion.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/executor/nodeRecursiveunion.c b/src/backend/executor/nodeRecursiveunion.c index acded079e24..5b734c05050 100644 --- a/src/backend/executor/nodeRecursiveunion.c +++ b/src/backend/executor/nodeRecursiveunion.c @@ -43,7 +43,8 @@ build_hash_table(RecursiveUnionState *rustate) node->numGroups, 0, rustate->tableContext, - rustate->tempContext); + rustate->tempContext, + false); } |