From b81b5a96f424531b97cdd1dba97d9d1b9c9d372e Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Fri, 16 Dec 2016 10:03:08 -0500 Subject: 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 --- src/include/executor/executor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/include/executor/executor.h') diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h index b4d09f95640..3f649faf2fe 100644 --- a/src/include/executor/executor.h +++ b/src/include/executor/executor.h @@ -143,7 +143,7 @@ extern TupleHashTable BuildTupleHashTable(int numCols, AttrNumber *keyColIdx, FmgrInfo *hashfunctions, long nbuckets, Size additionalsize, MemoryContext tablecxt, - MemoryContext tempcxt); + MemoryContext tempcxt, bool use_variable_hash_iv); extern TupleHashEntry LookupTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot, bool *isnew); -- cgit v1.2.3