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

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: pgbench: introduce a new automatic variable 'client_number'
Дата
Msg-id 51B441C0.5050501@vmware.com
обсуждение исходный текст
Ответ на pgbench: introduce a new automatic variable 'client_number'  (Gurjeet Singh <gurjeet@singh.im>)
Список 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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Cédric Villemain
Дата:
Сообщение: Re: Proposed patch: remove hard-coded limit MAX_ALLOCATED_DESCS
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Batch API for After Triggers