pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: PostgreSQL Developers <pgsql-hackers@postgresql.org>
Subject: Re: pgbench stats per script & other stuff
Date: Wed, 22 Jul 2015 21:26:51 +0200
Message-ID: <20150722192651.GO5596@postgresql.org> (raw)
In-Reply-To: <alpine.DEB.2.10.1507212038130.30948@sto>
References: <alpine.DEB.2.10.1507171544450.26125@sto>
	<CA+Tgmoa=ud6E=4afK3srNj_4j8Cckm4OD_=0=uxSD5JVwsO4rQ@mail.gmail.com>
	<alpine.DEB.2.10.1507211626000.30948@sto>
	<CA+TgmoYQi7sPG+b_19Y4bn2wUPUujsSZ_qOF8nWZTrC1Pbqivg@mail.gmail.com>
	<alpine.DEB.2.10.1507211819460.30948@sto>
	<alpine.DEB.2.10.1507212038130.30948@sto>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Fabien COELHO wrote:
> 
> >>[...] and that a subsequent -w modifies the meaning of the
> >>script-specifiying argument already read. That strikes me as a very
> >>unintuitive interface.
> >
> >Ok, I understand this "afterward modification" objection.
> >
> >What if the -w would be required *before*, and supply a weight for (the
> >first/maybe all) script(s) specified *afterwards*, so it does not modify
> >something already provided? I think it would be more intuitive, or at
> >least less surprising.
> 
> Here is a v3 which does that. If there is a better idea, do not hesitate!

This seems a moderately reasonable interface to me.  There are other
programs that behave in that way, and once you get used to the idea, it
makes sense.

I think for complete consistency we would have to require that -w is
specified for all scripts or none of them.  I am not sure if this means
that it's okay to have later scripts use a weight specified for a
previous one (i.e. it's only an error to fail to specify a weight for
options before the first -w), or each -f must have always its own -w
explicitely.  In other words,
    pg_bench -w2 -f script1.sql -f script2.sql
either script2 has weight 2, or it's an error, depending on what we
decide; but
    pg_bench -f script1.sql -w 2 -fscript2.sql
is always an error.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
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: <20150722192651.GO5596@postgresql.org>
Permalink:  ../20150722192651.GO5596@postgresql.org/
Also on:    postgresql.org/message-id/20150722192651.GO5596@postgresql.org

 · 

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: alvherre@2ndquadrant.com, coelho@cri.ensmp.fr, robertmhaas@gmail.com
  Subject: Re: pgbench stats per script & other stuff
  In-Reply-To: <20150722192651.GO5596@postgresql.org>

* 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