pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ildar Musin <i.musin@postgrespro.ru>
To: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: General purpose hashing func in pgbench
Date: Thu, 11 Jan 2018 19:21:46 +0300
Message-ID: <291822a3-0b3a-0b21-c694-c10776f516ac@postgrespro.ru> (raw)
In-Reply-To: <alpine.DEB.2.20.1801101903150.15856@lancre>
References: <0e8bd39e-dfcd-2879-f88f-272799ad7ef2@postgrespro.ru>
	<alpine.DEB.2.20.1712200807550.5165@lancre>
	<699225ee-c30c-b22e-4028-415e9eab26b2@postgrespro.ru>
	<alpine.DEB.2.20.1712211620040.32625@lancre>
	<80e9c570-5c49-1a01-f309-3d8d0cbbae42@postgrespro.ru>
	<alpine.DEB.2.20.1712240846440.22976@lancre>
	<38f1503e-7b63-4612-24a9-041af25bb022@postgrespro.ru>
	<alpine.DEB.2.20.1712251506160.22976@lancre>
	<af1ccd41-dcd0-f56b-0a05-a558da54762b@postgrespro.ru>
	<alpine.DEB.2.20.1712251702170.22976@lancre>
	<9603bac9-ae5d-36c5-5978-a88bdb700e37@postgrespro.ru>
	<alpine.DEB.2.20.1801092000230.2326@hendaye>
	<63f5a6ac-0c5b-8d59-ca8b-fc8e11244a66@postgrespro.ru>
	<alpine.DEB.2.20.1801101903150.15856@lancre>



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 





view thread (44+ messages)  latest in thread

Message-ID: <291822a3-0b3a-0b21-c694-c10776f516ac@postgrespro.ru>
Permalink:  ../291822a3-0b3a-0b21-c694-c10776f516ac@postgrespro.ru/
Also on:    postgresql.org/message-id/291822a3-0b3a-0b21-c694-c10776f516ac@postgrespro.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: i.musin@postgrespro.ru, coelho@cri.ensmp.fr
  Subject: Re: General purpose hashing func in pgbench
  In-Reply-To: <291822a3-0b3a-0b21-c694-c10776f516ac@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox