pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: pgbench stats per script & other stuff
Date: Wed, 2 Sep 2015 19:26:17 +0200
Message-ID: <20150902172617.GJ5286@alap3.anarazel.de> (raw)
In-Reply-To: <alpine.DEB.2.10.1507301801500.22793@sto>
References: <alpine.DEB.2.10.1507220706260.5636@sto>
	<WM!36f7f6aea11042e334dd8ddca8dd52df3de0913ec1f5bc42bfcc27f3eb60d576c8dac02c33f02b88abead156dfec3da0!@asav-2.01.com>
	<55AFD8C6.8010507@agliodbs.com>
	<CA+TgmobZSBmWzugAQp94=q98c2fmSBc+gRPwfNM+94dhjpL3tg@mail.gmail.com>
	<alpine.DEB.2.10.1507231759400.10585@sto>
	<CA+TgmoZEvNJ8wkVdHCsWnsz8Rz-MHebGp4DY+8WjiU-xYPT6Nw@mail.gmail.com>
	<alpine.DEB.2.10.1507250910540.20046@sto>
	<alpine.DEB.2.10.1507251618230.25082@sto>
	<alpine.DEB.2.10.1507281626330.3538@sto>
	<alpine.DEB.2.10.1507301801500.22793@sto>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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[@weight]</></term>
> +      <term><option>--builtin</> <replaceable>scriptname[@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@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@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


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (92+ messages)  latest in thread

Message-ID: <20150902172617.GJ5286@alap3.anarazel.de>
Permalink:  ../20150902172617.GJ5286@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20150902172617.GJ5286@alap3.anarazel.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: andres@anarazel.de, coelho@cri.ensmp.fr, robertmhaas@gmail.com, josh@agliodbs.com
  Subject: Re: pgbench stats per script & other stuff
  In-Reply-To: <20150902172617.GJ5286@alap3.anarazel.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox