Re: General purpose hashing func in pgbench

From: Ildar Musin <i(dot)musin(at)postgrespro(dot)ru>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: General purpose hashing func in pgbench
Date: 2018-01-09 16:31:02
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

09/01/2018 19:22, Ildar Musin пишет:
> Hello Fabien,
> 25/12/2017 19:17, Fabien COELHO пишет:
>>>> However, the key can be used if controlled so that different values do
>>>> not have the same randomization in different part of the script, so as
>>>> to avoid using the same patterns for different things if not desirable.
>>> Original murmur algorithm accepts seed as a parameter, which can be used
>>> for this purpose. I used value itself as a seed in the patch, but I can
>>> turn it into a function argument.
>> Hmmm. Possibly. However it needs a default, something like
>>   x = hash(v[, key])
>> with key some pseudo-random value?
> Sorry for a long delay. I've added hash() function which is just an
> alias for murmur2. I've also utilized variable arguments feature from
> least()/greates() functions to make optional seed parameter, but I
> consider this as a hack. Should we probably add some infrastructure for
> optional arguments? Docs and tests are on their way.
> Thanks!
I forgot to attach couple of fresh charts that show how distribution
changes with respect to seed.

Ildar Musin
Postgres Professional:
Russian Postgres Company

Attachment Content-Type Size
fnv_seed.png image/png 95.3 KB
murmur2_seed.png image/png 87.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Antonin Houska 2018-01-09 16:48:25 Re: [HACKERS] Secondary index access optimizations
Previous Message Ildar Musin 2018-01-09 16:22:14 Re: General purpose hashing func in pgbench