Re: Sample rate added to pg_stat_statements
| От | Andrey M. Borodin |
|---|---|
| Тема | Re: Sample rate added to pg_stat_statements |
| Дата | |
| Msg-id | 6482A576-4465-4E46-A42C-F1767E8DDE30@yandex-team.ru обсуждение исходный текст |
| Ответ на | Re: Sample rate added to pg_stat_statements ("Andrey M. Borodin" <x4mmm@yandex-team.ru>) |
| Ответы |
Re: Sample rate added to pg_stat_statements
|
| Список | pgsql-hackers |
> On 6 Jan 2025, at 15:50, Ilia Evdokimov <ilya.evdokimov@tantorlabs.com> wrote:
>
> Any suggestions for improvements?
The patch looks good to me, just a few nits.
0. Perhaps, we could have a test for edge values of 0 and 1. I do not insist, just an idea to think about.
1. This code seems a little different from your patch. It is trying to avoid engaging PRNG. I'm not sure it's a good
idea,but still. Also, it uses "<=", not "<".
xact_is_sampled = log_xact_sample_rate != 0 &&
(log_xact_sample_rate == 1 ||
pg_prng_double(&pg_global_prng_state) <= log_xact_sample_rate);
Thanks!
Best regards, Andrey Borodin.
В списке pgsql-hackers по дате отправления: