Re: Postgres 11, partitioning with a custom hash function

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Postgres 11, partitioning with a custom hash function
Дата
Msg-id CAKJS1f-aTO=ipnVFuM3N6sf2+Cub+vasxtw4ZN0ei2TTfJ+m4g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Postgres 11, partitioning with a custom hash function  (Harry B <harrysungod@gmail.com>)
Ответы Re: Postgres 11, partitioning with a custom hash function  (Harry B <harrysungod@gmail.com>)
Список pgsql-general
On 5 October 2018 at 06:18, Harry B <harrysungod@gmail.com> wrote:
>
> Thank you David! These helped me create an operator class.
> However, there still seems to be a 'off-by-a-fixed-N' difference between the
> hash value returned and how PG selects the partition.

hmm, actually, this is probably due to the hash_combine64() call in
compute_partition_hash_value(). This seems to combine the hash value
with 0 regardless of if there's another partition key column to hash.
If you could somehow do the reverse of what hash_combine64() will do
to you hash before returning it to the function then you might get
somewhere, but that does not look possible since it appears to be
throwing away some bits.

It may not have been a great choice to decide to have
compute_partition_hash_value() do this unnecessary combine, but it's
likely a few months too late to change that now.

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


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

Предыдущее
От: Harry B
Дата:
Сообщение: Re: Postgres 11, partitioning with a custom hash function
Следующее
От: Harry B
Дата:
Сообщение: Re: Postgres 11, partitioning with a custom hash function