Re: [Review] pgbench duration option

Поиск
Список
Период
Сортировка
От Brendan Jurd
Тема Re: [Review] pgbench duration option
Дата
Msg-id 37ed240d0809050845x73789ba7m725d10d976958293@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pgbench duration option  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: [Review] pgbench duration option
Список pgsql-hackers
Hello again,

I received the following email from a helpful fellow off-list,
pointing out an error in my review:

On Fri, Sep 5, 2008 at 7:03 PM, Ragnar <gnari@hive.is> wrote:
> On fös, 2008-09-05 at 15:07 +1000, Brendan Jurd wrote:
>> Wouldn't this be better written as:
>>
>>                       if ((duration > 0 && timer_exceeded) || st->cnt >= nxacts)
>>                       {
>>                               <stop>
>>                       }
>
> sorry, but these do not lok as the same thing to me.
>
> in the first variant there will not be a stop if
>  (duration > 0) and NOT (timer_exceeded) and (st->cnt >= nxacts)
> but in the second variant there will.
>
> admittedly, i have no idea if that situation can occur.
>
> gnari
>

gnari is right.  Looking closer I see that nxacts defaults to 10 in
the absence of a -t option, so my version of the code would end up
stopping when the run reaches 10 transactions, even if the user has
specified a -T option.

Sorry for the error.  The (duration > 0) test does in fact need to be separate.

Thanks for the catch, gnari.

Cheers,
BJ


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: plpgsql is not translate-aware
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: plpgsql is not translate-aware