Re: HASH partitioning not working properly

Поиск
Список
Период
Сортировка
От Srinivasa T N
Тема Re: HASH partitioning not working properly
Дата
Msg-id CAFruNdeXzVG25yvvpZxBY6_LRgi2azPvAR9qLdnrxNhtVmD+Pg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: HASH partitioning not working properly  (David Rowley <dgrowleyml@gmail.com>)
Ответы Re: HASH partitioning not working properly  (Laurenz Albe <laurenz.albe@cybertec.at>)
Список pgsql-general



On Fri, Jun 19, 2020 at 11:44 AM David Rowley <dgrowleyml@gmail.com> wrote:
On Fri, 19 Jun 2020 at 17:42, Srinivasa T N <seenutn@gmail.com> wrote:
>    After seeing the below, I feel partitioning is not working properly or it maybe case that my understanding is wrong.  Can somebody explain me what is happening?

> postgres=# select * from busbar_version6;
>  objectid | ver_id
> ----------+--------
> (0 rows)
>
> postgres=# select * from busbar_version7;
>  objectid | ver_id
> ----------+--------
>         6 |      6
> (1 row)
>
>    Why second insert has gone to table busbar_version7 instead of busbar_version6?

It's your understanding that's not correct.  The value of is passed
through a hash function and the partition is selected based partition
matching the remainder value after dividing the return value of the
hash function by the largest modulus of any partition.

That might surprise you, but how would you select which partition a
varchar value should go into if you didn't use a hash function.

David

How can I see the output of hash function that is used internally?

Regards,
Seenu. 

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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: HASH partitioning not working properly
Следующее
От: Laurenz Albe
Дата:
Сообщение: Re: HASH partitioning not working properly