Re: gaussian distribution pgbench
От | Fabien COELHO |
---|---|
Тема | Re: gaussian distribution pgbench |
Дата | |
Msg-id | alpine.DEB.2.02.1311220907320.28145@sto обсуждение исходный текст |
Ответ на | Re: gaussian distribution pgbench (Heikki Linnakangas <hlinnakangas@vmware.com>) |
Список | 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.
В списке pgsql-hackers по дате отправления: