Re: pgbench: introduce a new automatic variable 'client_number'

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Gurjeet Singh <gurjeet(at)singh(dot)im>
Cc: PGSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgbench: introduce a new automatic variable 'client_number'
Date: 2013-06-09 08:50:08
Message-ID: 51B441C0.5050501@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 06.06.2013 06:53, Gurjeet Singh wrote:
> Please find attached a patch for pgbench that introduces a new
> auto-variable 'client_number'. Following in the footsteps of 'scale'
> auto-variable, this is not declared if the user has specified this variable
> using -D switch.
>
> Since 'clientid' is a very common name a user can use for their own
> script's variable, I chose to call this auto-variable client_number; just
> to avoid conflicts.

Hmm, I'm not sure I care too much about that, to be honest. We have
'scale' as an auto-variable as well, which is also a common word. Also,
if there's an existing script out there that does "\set client_id ...",
it will override the automatic value, and work as it used to.

Another reason to name it "client_id" is that in the pgbench -l log
format, the documentation calls the first column "client_id". Makes
sense to call the auto-variable the same.

I think you forgot to compile with the patch, because there's a
semicolon missing ;-). I moved the code around a bit, setting the
variable next to where :scale is set; that's more readable. In the docs,
I split the descriptions of :scale and :client_id into a table.

I'll commit the attached as soon as the tree opens for 9.4 development.

- Heikki

Attachment Content-Type Size
pgbench-client_id-2.patch text/x-diff 2.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2013-06-09 08:58:49 Re: Batch API for After Triggers
Previous Message Cédric Villemain 2013-06-09 08:21:07 Re: Proposed patch: remove hard-coded limit MAX_ALLOCATED_DESCS