Re: PATCH: pgbench - random sampling of transaction written into log

Поиск
Список
Период
Сортировка
От Jeff Janes
Тема Re: PATCH: pgbench - random sampling of transaction written into log
Дата
Msg-id CAMkU=1w7TipE1ST_mp=A+rjdvrWPd_ojO45kkxtq3MFhcZPWLw@mail.gmail.com
обсуждение исходный текст
Ответ на PATCH: pgbench - random sampling of transaction written into log  ("Tomas Vondra" <tv@fuzzy.cz>)
Ответы Re: PATCH: pgbench - random sampling of transaction written into log
Список pgsql-hackers
On Fri, Aug 24, 2012 at 2:16 PM, Tomas Vondra <tv@fuzzy.cz> wrote:
> Hi,
>
> attached is a patch that adds support for random sampling in pgbench, when
> it's executed with "-l" flag. You can do for example this:
>
>   $ pgbench -l -T 120 -R 1 db
>
> and then only 1% of transactions will be written into the log file. If you
> omit the tag, all the transactions are written (i.e. it's backward
> compatible).

Hi Tomas,

You use the rand() function.  Isn't that function not thread-safe?
Or, if it is thread-safe, does it accomplish that with a mutex?  That
was a problem with a different rand function used in pgbench that
Robert Haas fixed a while ago, 4af43ee3f165c8e4b332a7e680.

Also, what benefit is had by using modulus on rand(), rather than just
modulus on an incrementing counter?

Could you explain the value of this patch, given your other one that
does aggregation?  If both were accepted, I think I would always use
the aggregation one in preference to this one.

Thanks,

Jeff



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: timestamptz parsing bug?
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: psql \set vs \copy - bug or expected behaviour?