Re: [HACKERS] No: implied sort with group by
Zeugswetter Andreas <andreas.zeugswetter@telecom.at>
From: Zeugswetter Andreas DBT <Andreas.Zeugswetter@telecom.at>
To: "'pgsql-hackers@hub.org'" <pgsql-hackers@hub.org>
Date: 1998-01-29T10:23:15Z
Lists: 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