Re: pgbench stats per script & other stuff

From: Andres Freund <andres(at)anarazel(dot)de>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
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 17:26:17
Message-ID: 20150902172617.GJ5286@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2015-07-30 18:03:56 +0200, Fabien COELHO wrote:
>
> >v6 is just a rebase after a bug fix by Andres Freund.
> >
> >Also a small question: The patch currently displays pgbench scripts
> >starting numbering at 0. Probably a little too geek... should start at 1?
>
> v7 is a rebase after another small bug fix in pgbench.
>
> --
> Fabien.

> diff --git a/doc/src/sgml/ref/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgml
> index 2517a3a..99670d4 100644
> --- a/doc/src/sgml/ref/pgbench.sgml
> +++ b/doc/src/sgml/ref/pgbench.sgml
> @@ -261,6 +261,23 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
> benchmarking arguments:
>
> <variablelist>
> + <varlistentry>
> + <term><option>-b</> <replaceable>scriptname[(at)weight]</></term>
> + <term><option>--builtin</> <replaceable>scriptname[(at)weight]</></term>
> + <listitem>
> + <para>
> + Add the specified builtin script to the list of executed scripts.
> + An optional integer weight after <literal>@</> allows to adjust the
> + probability of drawing the test.
> + Available builtin scripts are: <literal>tpcb-like</>,
> + <literal>simple-update</> and <literal>select-only</>.
> + The provided <repleacable>scriptname</> needs only to be a prefix
> + of the builtin name, hence <literal>simp</> would be enough to select
> + <literal>simple-update</>.
> + </para>
> + </listitem>
> + </varlistentry>

Maybe add --builtin list to show them?

> @@ -404,10 +422,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
> <term><option>--skip-some-updates</option></term>
> <listitem>
> <para>
> - Do not update <structname>pgbench_tellers</> and
> - <structname>pgbench_branches</>.
> - This will avoid update contention on these tables, but
> - it makes the test case even less like TPC-B.
> + Shorthand for <option>-b simple-update(at)1</>.
> </para>
> </listitem>
> </varlistentry>

> @@ -511,7 +526,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
> <term><option>--select-only</option></term>
> <listitem>
> <para>
> - Perform select-only transactions instead of TPC-B-like test.
> + Shorthand for <option>-b select-only(at)1</>.
> </para>
> </listitem>
> </varlistentry>

I'm a bit inclined to remove these options.

> <para>
> - The default transaction script issues seven commands per transaction:
> + Pgbench executes test scripts chosen randomly from a specified list.
> + They include built-in scripts with <option>-b</> and
> + user-provided custom scripts with <option>-f</>.
> + 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</>.
> + </para>

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?

> +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?

> + 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.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2015-09-02 17:30:33 Re: Improving test coverage of extensions with pg_dump
Previous Message Andres Freund 2015-09-02 17:15:10 Re: GIN pending clean up is not interruptable