Re: pgbench stats per script & other stuff

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgbench stats per script & other stuff
Date: 2015-09-02 18:20:45
Message-ID: alpine.DEB.2.10.1509022002110.21677@sto
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Andres,

> Maybe add --builtin list to show them?

Yep, easy enough.

>> [...]
>> + Shorthand for <option>-b simple-update(at)1</>.
>> + Shorthand for <option>-b select-only(at)1</>.
>
> I'm a bit inclined to remove these options.

Hm...

This is really backward compatibility, and people may find reference to
these in blogs or elswhere, so I think that it would make sense to
be upward compatible.

I would certainly be against adding any other of these options, though.

>> + Each script may be given a relative weight specified after a
>> + <literal>@</> so as to change its drawing probability.
>> + The default weight is <literal>1</>.
>
> I'm wondering if percentages instead of weights would be a better
> idea. That'd mean you'd be forced to be more careful when adding another
> script (having to adjust the percentages of other scripts) but arguably
> that's a good thing?

If you use only percent, then you have to check that the total is 100,
probably you have to use floats, to do something when the total is not
100, checking would complicate the code and test people mental calculus
abilities. Not sure this is a good idea:-)

In the use case you outline, when adding a script, maybe you know that it
runs "as much as" this other script, so you can pick up the same weight
without bothering.

Also, when testing, there is an issue when you want to remove one script
for a quick test, and that would mean changing all percentages on the
command line...

So I would advise not to put such a constraint.

>> +static SQLScript sql_script[MAX_SCRIPTS];
>>
>> +static struct {
>> + char *name; /* very short name for -b ...*/
>> + char *desc; /* short description */
>> + char *script; /* actual pgbench script */
>> +} builtin_script[]
>
> Can't we put these in the same array?

I do not understand.

>> + printf("transaction type: %s\n",
>> + num_scripts == 1? sql_script[0].name: "multiple scripts");
>
> Seems like it'd be more useful to simply always list the scripts +
> weights here.

The detailed list is shown later, with the summary performance figure for
each scripts, so ISTM that it would be redundant? Maybe the transaction
type could be moved downwards just before said list?

--
Fabien.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-09-02 18:27:03 Re: Horizontal scalability/sharding
Previous Message Tom Lane 2015-09-02 18:03:56 Re: Hooking at standard_join_search (Was: Re: Foreign join pushdown vs EvalPlanQual)