Re: gaussian distribution pgbench

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: KONDO Mitsumasa <kondo(dot)mitsumasa(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: gaussian distribution pgbench
Date: 2014-03-03 07:51:22
Message-ID: alpine.DEB.2.10.1403030845060.20310@sto
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


>> \setrandom foo 1 10 [uniform]
>> \setrandom foo 1 :size gaussian 3.6
>> \setrandom foo 1 100 exponential 7.2
> It's good design. I think it will become more low overhead at part of parsing
> in pgbench, because comparison of strings will be redeced(maybe). And I'd
> like to remove [uniform], beacause we have to have compatibility for old
> scripts, and random function always gets uniform distribution in common sense
> of programming.

I just put "uniform" as an optional default, hence the brackets.

Otherwise, what I would have in mind if this would be designed from
scratch:

\set foo 124
\set foo "string value" (?)
\set foo :variable
\set foo 12 + :shift

And then

\set foo uniform 1 10
\set foo gaussian 1 10 4.2
\set foo exponential 1 100 5.2

or maybe functions could be repended with something like "&uniform".
But that would be for another life:-)

> However, new grammer is little bit long in user script. It seems trade-off
> that are visibility of scripts and user writing cost.

Yep.

--
Fabien.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2014-03-03 07:55:21 Re: proposal, patch: allow multiple plpgsql plugins
Previous Message Stephen Frost 2014-03-03 07:50:21 Re: Securing "make check" (CVE-2014-0067)