Re: General purpose hashing func in pgbench - Mailing list pgsql-hackers

From Ildar Musin
Subject Re: General purpose hashing func in pgbench
Date
Msg-id 9603bac9-ae5d-36c5-5978-a88bdb700e37@postgrespro.ru
Whole thread Raw
In response to Re: General purpose hashing func in pgbench  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: General purpose hashing func in pgbench
Re: General purpose hashing func in pgbench
List pgsql-hackers
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!

-- 
Ildar Musin
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company 


Attachment

pgsql-hackers by date:

Previous
From: Vik Fearing
Date:
Subject: Re: [HACKERS] PATCH: psql tab completion for SELECT
Next
From: Ildar Musin
Date:
Subject: Re: General purpose hashing func in pgbench