Re: gaussian distribution pgbench - Mailing list pgsql-hackers

From KONDO Mitsumasa
Subject Re: gaussian distribution pgbench
Date
Msg-id 53196EF7.8060006@lab.ntt.co.jp
Whole thread Raw
In response to Re: gaussian distribution pgbench  (KONDO Mitsumasa <kondo.mitsumasa@lab.ntt.co.jp>)
Responses Re: gaussian distribution pgbench
Re: gaussian distribution pgbench
List pgsql-hackers
Hi,

(2014/03/04 17:42), KONDO Mitsumasa wrote:> (2014/03/04 17:28), Fabien COELHO wrote:
 >>> OK. I'm not sure which idia is the best. So I wait for comments in community:)
 >> Hmmm. Maybe you can do what Tom voted for, he is the committer:-)
 > Yeah, but he might change his mind by our disscuttion. So I wait untill tomorrow,
 > and if nothing to comment, I will start to fix what Tom voted for.
I create the patch which is fixed UI. If we agree with this interface,
I also start to fix the document.


New "\setrandom" interface is here.
   \setrandom var min max [gaussian threshold | exponential threshold]

Attached patch realizes this interface, but it has little bit ugly codeing in
executeStatement() and process_commands().. That is under following.
if(argc == 4)
{
... /* uniform */
}
else if (argv[4]== gaussian or exponential)
{
... /* gaussian or exponential */
}
else
{
... /* uniform with extra argments */
}

It is beacause pgbench custom script allows extra comments or extra argument in
its file. For example, under following cases are no problem case.
   \setrandom var min max #hoge   --> uniform random
   \setrandom var min max #hoge1 #hoge2  --> uniform random
   \setrandom var min max gaussian threshold #hoge  -->gaussian random

And other cases are classified under following.
   \setrandom var min max gaussian #hoge --> uniform
   \setrandom var min max max2 gaussian threshold --> uniform
   \setrandom var min gaussian #hoge --> ERROR

However, if we wrong grammer in pgbench custom script,
pgbench outputs error log on user terminal. So I think it is especially no problem.

What do you think?

Regards,
--
Mitsumasa KONDO
NTT Open Source Software Center

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: syslog_ident mentioned as syslog_identify in the docs
Next
From: KONDO Mitsumasa
Date:
Subject: Re: gaussian distribution pgbench