|From:||Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>|
|To:||Adrien Nayrat <adrien(dot)nayrat(at)anayrat(dot)info>|
|Cc:||PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>|
|Subject:||Re: Log statement sample - take two|
|Views:||Raw Message | Whole Thread | Download mbox | Resend email|
On Sat, Oct 19, 2019 at 05:02:01PM +0200, Adrien Nayrat wrote:
>This patch propose a new way to sample statement to logs.
>As a reminder, this feature was committed in PG12 then reverted after the
>proposition of log_statement_sample_limit
>The first implementation added a new GUC to sample statement logged by
>log_min_duration_statement. Then, we wanted to add the ability to log all
>statement whose duration exceed log_statement_sample_limit.
>This was confusing because log_min_duration behaves as a minimum to enable
>sampling. While log_statement_sample_limit behave as maximum to disable it.
>Tomas Vondra proposed to use two minimum thresholds:
>> 1) log_min_duration_sample - enables sampling of commands, using the
>> existing GUC log_statement_sample_rate
>> 2) log_min_duration_statement - logs all commands exceeding this
>This patch implement this idea.
>PS: I notice I forgot to mention "Only superusers can change this setting" in
>the log_transaction_sample_rate documentation. It attached a second patch to fix
Seems fine to me, mostly. I think the docs should explain how
log_min_duration_statement interacts with log_min_duration_sample.
Attached is a patch doing that, by adding one para to each GUC, along
with some minor rewordings. I think the docs are mixing "sampling"
vs. "logging" and "durations" vs. "statements" not sure.
I also think the two new sampling GUCs (log_min_duration_sample and
log_statement_sample_rate) should be next to each other. We're not
ordering the GUCs alphabetically anyway.
I plan to make those changes and push in a couple days.
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
|Next Message||Thomas Munro||2019-11-04 01:28:36||Re: fe-utils - share query cancellation code|
|Previous Message||Thomas Munro||2019-11-04 00:39:32||Re: let's make the list of reportable GUCs configurable (was Re: Add %r substitution for psql prompts to show recovery status)|