Re: idea: log_statement_sample_rate - bottom limit for sampling

From: Adrien Nayrat <adrien(dot)nayrat(at)anayrat(dot)info>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Gilles Darold <gilles(at)darold(dot)net>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: idea: log_statement_sample_rate - bottom limit for sampling
Date: 2019-06-18 12:03:27
Message-ID: 1901439b-3ebb-6606-35b4-26415f1432ce@anayrat.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I tried the patch, here my comment:

> gettext_noop("Zero effective disables sampling. "
> "-1 use sampling every time (without limit)."),

I do not agree with the zero case. In fact, sampling is disabled as soon as
setting is less than log_min_duration_statements. Furthermore, I think we should
provide a more straightforward description for users.

I changed few comments and documentation:

* As we added much more logic in this function with statement and transaction
sampling. And now with statement_sample_rate, it is not easy to understand the
logic on first look. I reword comment in check_log_duration, I hope it is more
straightforward.

* I am not sure if "every_time" is a good naming for the variable. In fact, if
duration exceeds limit we disable sampling. Maybe sampling_disabled is more clear?

* I propose to add some words in log_min_duration_statement and
log_statement_sample_rate documentation.

* Rephrased log_statement_sample_limit documentation, I hope it help
understanding.

Patch attached.

Regards,

--
Adrien

Attachment Content-Type Size
log_statement_sample_limit-3.patch text/x-patch 6.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2019-06-18 12:05:00 Replacing the EDH SKIP primes
Previous Message Steve Singer 2019-06-18 11:57:36 Re: PG 12 beta 1 segfault during analyze