Re: Sample rate added to pg_stat_statements - Mailing list pgsql-hackers

From Ilia Evdokimov
Subject Re: Sample rate added to pg_stat_statements
Date
Msg-id fdcdad79-7258-410d-b0c4-f488087dca7d@tantorlabs.com
Whole thread Raw
In response to Re: Sample rate added to pg_stat_statements  ("Andrey M. Borodin" <x4mmm@yandex-team.ru>)
List pgsql-hackers
On 09.01.2025 22:13, Alena Rybakina wrote:
> Hi! Thank you for the work with this subject.
>
> I looked at your patch and noticed that this part of the code is 
> repeated several times:
>
> if (nesting_level == 0)
>     {
>         if (!IsParallelWorker())
>             current_query_sampled = 
> pg_prng_double(&pg_global_prng_state) < pgss_sample_rate;
>         else
>             current_query_sampled = false;
>
>     }
>
> I think you should put this in a function like 
> update_current_query_sampled. I've attached a diff file with the changes.
>

Agree, thanks.


--
Best regards,
Ilia Evdokimov,
Tantor Labs LLC.




pgsql-hackers by date:

Previous
From: Michail Nikolaev
Date:
Subject: Re: Why doesn't GiST VACUUM require a super-exclusive lock, like nbtree VACUUM?
Next
From: Ilia Evdokimov
Date:
Subject: Re: Sample rate added to pg_stat_statements