Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZIKDv-0005Uo-4s for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Jul 2015 17:23:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZIKDu-0006yh-Mj for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Jul 2015 17:23:58 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZIKCZ-00019V-Qi for pgsql-hackers@postgresql.org; Thu, 23 Jul 2015 17:22:35 +0000 Received: from smtp-auth.no-ip.com ([8.23.224.61] helo=out.smtp-auth.no-ip.com) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZIKCV-0006aM-AZ for pgsql-hackers@postgresql.org; Thu, 23 Jul 2015 17:22:34 +0000 X-No-IP: alvh.no-ip.org@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from alvin.alvh.no-ip.org (unknown [186.37.86.38]) (Authenticated sender: alvh.no-ip.org@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id C60D44012E0; Thu, 23 Jul 2015 10:22:24 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 98D733D28; Wed, 22 Jul 2015 21:26:51 +0200 (CEST) Date: Wed, 22 Jul 2015 21:26:51 +0200 From: Alvaro Herrera To: Fabien COELHO Cc: Robert Haas , PostgreSQL Developers Subject: Re: pgbench stats per script & other stuff Message-ID: <20150722192651.GO5596@postgresql.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -1.6 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org 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