From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Adrien Nayrat <adrien.nayrat@anayrat.info>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: idea: log_statement_sample_rate - bottom limit for sampling
Date: Wed, 6 Nov 2019 19:21:06 +0100
Message-ID: <20191106182106.dwdvxalewyydqbx3@development> (raw)
In-Reply-To: <20190804214154.tbr5pbg5wss2adfu@development>
References: <4540bafe-1b23-a6ce-a313-f3b03bb418df@anayrat.info>
<cfe72bab-dc4c-d194-4ea2-ac9dc89d6243@anayrat.info>
<20190801100445.yo5v3pdxelijztzm@development>
<3f6b75ea-03bb-7c35-1f20-e989f4b7f9ac@anayrat.info>
<20190804191037.em6rmlvxjpcsjtqu@development>
<25079.1564946172@sss.pgh.pa.us>
<20190804195823.qi7vntgybfgitdnn@development>
<27954.1564950312@sss.pgh.pa.us>
<20190804204848.7f7ypsbijpgxojxx@development>
<20190804214154.tbr5pbg5wss2adfu@development>
On Sun, Aug 04, 2019 at 11:41:54PM +0200, Tomas Vondra wrote:
>On Sun, Aug 04, 2019 at 10:48:48PM +0200, Tomas Vondra wrote:
>>On Sun, Aug 04, 2019 at 04:25:12PM -0400, Tom Lane wrote:
>>>Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
>>>>On Sun, Aug 04, 2019 at 03:16:12PM -0400, Tom Lane wrote:
>>>>>Isn't the issue here the interaction between log_transaction_sample_rate
>>>>>and log_min_duration_statement?
>>>
>>>>No, that interaction only affects statement-level sampling.
>>>
>>>OK, I was confusing the features.
>>>
>>>>For transaction-level sampling we do the sampling independently of the
>>>>statement duration, i.e. we when starting a transaction we determine
>>>>whether the whole transaction will be sampled. It has nothing to do with
>>>>the proposed log_statement_sample_limit.
>>>
>>>So, to clarify: our plan is that a given statement will be logged
>>>if any of these various partial-logging features says to do so?
>>>
>>
>>Yes, I think that's the expected behavior.
>>
>>- did it exceed log_min_duration_statement? -> log it
>>- is it part of sampled xact? -> log it
>>- maybe sample the statement (to be reverted / reimplemented)
>>
>>>(And the knock on HEAD's behavior is exactly that it breaks that
>>>independence for log_min_duration_statement.)
>>>
>>
>>Yeah. There's no way to use sampling, while ensure logging of all
>>queries longer than some limit.
>>
>
>FWIW I've reverted the log_statement_sample_rate (both from master and
>REL_12_STABLE). May the buildfarm be merciful to me.
>
>I've left the log_transaction_sample_rate in, as that seems unaffected
>by this discussion.
>
I've pushed the reworked version of log_statement_sample_rate patch [1].
If I understand correctly, that makes this patch unnecessary, and we
should mark it as rejected. Or do we still need it?
regards
--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tomas.vondra@2ndquadrant.com, tgl@sss.pgh.pa.us, adrien.nayrat@anayrat.info, pgsql-hackers@lists.postgresql.org
Subject: Re: idea: log_statement_sample_rate - bottom limit for sampling
In-Reply-To: <20191106182106.dwdvxalewyydqbx3@development>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox