Re: gaussian distribution pgbench

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: KONDO Mitsumasa <kondo(dot)mitsumasa(at)lab(dot)ntt(dot)co(dot)jp>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: gaussian distribution pgbench
Date: 2013-11-22 08:24:10
Message-ID: alpine.DEB.2.02.1311220907320.28145@sto
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> 3. That said, this could be handy. But it would be even more handy if you
> could get Gaussian random numbers with \setrandom, so that you could use this
> with custom scripts. And once you implement that, do we actually need the -g
> flag anymore? If you want TPC-B transactions with gaussian distribution, you
> can write a custom script to do that. The documentation includes a full
> script that corresponds to the built-in TPC-B script.
>
> So what I'd actually like to see is \setgaussian, for use in custom scripts.

Indeed, great idea! That looks pretty elegant! It would be something like:

\setgauss var min max sigma

I'm not sure whether sigma should be relative to max-min, or absolute.
I would say relative is better...

A concerned I raised is that what one should really want is a "pseudo
randomized" (discretized) gaussian, i.e. you want the probability of each
value along a gaussian distribution, *but* no direct frequency correlation
between neighbors. Otherwise, you may have unwanted/unrealistic positive
cache effects. Maybe this could be achieved by an independent built-in,
say either:

\randomize var min max [parameter ?]
\randomize var min max val [parameter]

Which would mean take variable var which must be in [min,max], and apply a
pseudo-random transformation which results is also in [min,max].

From a probabilistic point of view, it seems to me that a randomized
(discretized) exponential would be more significant to model a server
load.

\setexp var min max lambda...

--
Fabien.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2013-11-22 08:26:43 Re: new unicode table border styles for psql
Previous Message Pavel Stehule 2013-11-22 08:23:48 Re: new unicode table border styles for psql