Hello Andres,
> Maybe add --builtin list to show them?
Yep, easy enough.
>> [...]
>> + Shorthand for <option>-b simple-update@1</>.
>> + Shorthand for <option>-b select-only@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.