pgbench: introduce a new automatic variable 'client_number'

From: Gurjeet Singh <gurjeet(at)singh(dot)im>
To: PGSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: pgbench: introduce a new automatic variable 'client_number'
Date: 2013-06-06 03:53:26
Message-ID: CABwTF4U2+jUdSVEWGdjbPsTsgJbfjL5n0nwdxPWXb=ONMg3hSA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

This variable can come in handy when you want to use a different expression
in a query depending on which client is executing it. An example custom
transaction is attached, where the UPDATE statement from any given client
always updates the same logical row.

Best regards,
--
Gurjeet Singh

http://gurjeet.singh.im/

EnterpriseDB Inc.

Attachment Content-Type Size
pgbench_add_cleint_number_variable.patch application/octet-stream 2.3 KB
test_update.sql application/octet-stream 67 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2013-06-06 04:29:41 Re: Support for REINDEX CONCURRENTLY
Previous Message 李海龙 2013-06-06 03:33:11 Re: I s this a bug of spgist index in a heavy write condition?