Re: Horribly slow hash join

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Horribly slow hash join
Дата
Msg-id 16041.1082354970@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Horribly slow hash join  (Greg Stark <gsstark@mit.edu>)
Ответы Re: Horribly slow hash join
Re: Horribly slow hash join
Re: Horribly slow hash join
Список pgsql-performance
Greg Stark <gsstark@mit.edu> writes:
> If the hash tables were made a power of two then it would be possible to mix
> the bits of the 32 bit value and just mask off the unneeded bits. I've found
> one page via google that mentions mixing bits in a hash function, but I would
> look for a more serious treatment somewhere.
>  http://burtleburtle.net/bob/hash/doobs.html
> Incidentally, this text claims mod is extremely slow compared to bit
> manipulations.

Modding by a *non* power of 2 (esp. a prime) mixes the bits quite well,
and is likely faster than any multiple-instruction way to do the same.

The quoted article seems to be by someone who has spent a lot of time
counting assembly cycles and none at all reading the last thirty years
worth of CS literature.  Knuth's treatment of hashing has some actual
math to it...

            regards, tom lane

В списке pgsql-performance по дате отправления:

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: Horribly slow hash join
Следующее
От: Dirk Lutzebäck
Дата:
Сообщение: Re: RESOLVED: Re: Wierd context-switching issue on Xeon