Re: Log a sample of transactions - Mailing list pgsql-hackers

From Adrien NAYRAT
Subject Re: Log a sample of transactions
Date
Msg-id fa577d4b-088c-8de9-a4f3-0aa63e3f2a37@anayrat.info
Whole thread Raw
In response to RE: Log a sample of transactions  ("Kuroda, Hayato" <kuroda.hayato@jp.fujitsu.com>)
Responses RE: Log a sample of transactions  ("Kuroda, Hayato" <kuroda.hayato@jp.fujitsu.com>)
Re: Log a sample of transactions  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On 1/23/19 3:12 AM, Kuroda, Hayato wrote:
> Dear Adrien,

Hello Kuroda-san

> 
> 
> ---- config.sgml ----
> You must document the behavior when users change the parameter during a transaction.
> あやしい・・・

Agreed, I added a wording.

>   
> ---- postgres.c ----
> I give you three comments.
> 
>> /* flag for logging statements in this transaction */
> I think "a" or the plural form should be used instead of "this"

Fixed

> 
> * xact_is_sampled is left at the end of a transaction.
> Should the parameter be set to false at the lowest layer of the transaction system?
> I understand it is unnecessary for the functionality, but it have more symmetry.

Yes, it is not necessary. I wonder what is more important : keep some 
kind of symmetry or avoid unnecessary code (which can be source of mistake)?

> 
> * check_log_duration should be used only when postgres check the duration.
> But I'm not sure a new function such as check_is_sampled is needed because A processing in new function will be as
almostsame as check_log_duration.
 

I agree, I asked myself the same question and I preferred to keep code 
simple.

Here is 4th patch.

Thanks!

Attachment

pgsql-hackers by date:

Previous
From: Lætitia Avrot
Date:
Subject: [Patch] Log10 and hyperbolic functions for SQL:2016 compliance
Next
From: Simon Riggs
Date:
Subject: Re: [PATCH] Allow UNLISTEN during recovery