21.04.2012 17:29, Dmitry Yemanov wrote:
> If you speak*only*  about grouping, then I believe you should compare
> hash aggregate vs sort aggregate as different data access methods, not
> hash table vs quick sort in the existing sorting implementation.

   Yes, I'm talking about hash grouping.

> And
> yes, hashing (as a complete replacement algorithm) can be much faster if
> the grouping keys are badly selective.

   What you think about this plan:

1) a little change in Hash make collision list ordered (which itself make Hash 
faster)
2) after filling Hash with data, value of hash is added to the beginning of key 
(in 
small-endian byte order, of course)
3) the result can be written to temp file in one pass and then used in existing 
merge sort 
because now it actually is sorted by pair "hash,key".

   I think it is easier than implementing whole new data access method from 
scratch.

-- 
   SY, SD.

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to