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 291822a3-0b3a-0b21-c694-c10776f516ac@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

10/01/2018 21:42, Fabien COELHO пишет:
>
> Hmm. I do not think that we should want a shared seed value. The seed
> should be different for each call so as to avoid undesired
> correlations. If wanted, correlation could be obtained by using an
> explicit identical seed.
>
> ISTM that the best way to add the seed is to call random() when the
> second arg is missing in make_func. Also, this means that the executor
> would always get its two arguments, so it would simplify the code there.
>
Ok, I think I understand what you meant. You meant the case like following:

\set x random(1, 100)
\set h1 hash(:x)
\set h2 hash(:x)  -- will have different seed from h1

so that different instances of hash function within one script would
have different seeds. Yes, that is a good idea, I can do that.

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



pgsql-hackers by date:

Previous
From: Chapman Flack
Date:
Subject: Re: numeric regression test passes, but why?
Next
From: Alvaro Herrera
Date:
Subject: Re: numeric regression test passes, but why?