Re: [HACKERS] No: implied sort with group by - Mailing list pgsql-hackers

From Zeugswetter Andreas DBT
Subject Re: [HACKERS] No: implied sort with group by
Date
Msg-id 219F68D65015D011A8E000006F8590C6010A51B2@sdexcsrv1.sd.spardat.at
Whole thread Raw
List pgsql-hackers
Ocie wrote:
>> 2.  Instead of sorting the tuples before grouping, add a hashing
system to
>> the group node so that the pre-sorting is not necessary.
>The hash should work.  If the hash key is built on the group-by items,
>then any row with the same entries in these columns will get hashed to
>the same result row.  At this point, it should be fairly easy to
>perform aggregation (test and substitute for min and max, add for
>sum,avg, etc).

Have been thinking about that too. Is each list in the current hash
implementation sorted ?
Cause else how do you know, that a certain value has not already been
processed ?
Answer: keep a list of already processed groups in memory. Initialize it
for each new hash list.

Andreas

pgsql-hackers by date:

Previous
From: "Igor Sysoev"
Date:
Subject: time stamps in logging
Next
From: Andrew Martin
Date:
Subject: Re: [HACKERS] No: implied sort with group by