Re: Hash support for arrays

Поиск
Список
Период
Сортировка
От marcin mank
Тема Re: Hash support for arrays
Дата
Msg-id AANLkTindyRFhaB-dbtFHhbBst8c+U9Gd0Q0rbLZao4MZ@mail.gmail.com
обсуждение исходный текст
Ответ на Hash support for arrays  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Hash support for arrays  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Sat, Oct 30, 2010 at 6:21 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> 3. To hash, apply the element type's hash function to each array
> element.  Combine these values by rotating the accumulator left
> one bit at each step and xor'ing in the next element's hash value.
>
> Thoughts?  In particular, is anyone aware of a better method
> for combining the element hash values?
>

This would make the hash the same for arrays with elements 32 apart swapped.

This is what boost does:
http://www.systomath.com/include/Boost-1_34/doc/html/boost/hash_combine.html

Greetings


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Hash support for arrays
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Hash support for arrays