Hash support for arrays

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Hash support for arrays
Дата
Msg-id 26749.1288455696@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: Hash support for arrays  (marcin mank <marcin.mank@gmail.com>)
Re: Hash support for arrays  (Greg Stark <gsstark@mit.edu>)
Список pgsql-hackers
I was reminded today that I'd promised to do $SUBJECT awhile back.
It's worth having so that hash joins and hash aggregation can work
on array values.  I believe this is a fairly straightforward
exercise:

1. Add a hash opclass that accepts ANYARRAY, similar to the existing
btree opclass for ANYARRAY.  It will work for any array type whose
element type has a hash opclass.

2. Coding is much like the array_cmp support code, including caching
the lookup of the element type's hash function.

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?
        regards, tom lane


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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: [RFC][PATCH]: CRC32 is limiting at COPY/CTAS/INSERT ... SELECT + speeding it up
Следующее
От: marcin mank
Дата:
Сообщение: Re: Hash support for arrays