Re: Suggestion about logging only every n-th statement - Mailing list pgsql-general

From Adrien NAYRAT
Subject Re: Suggestion about logging only every n-th statement
Date
Msg-id 2de13224-948c-3d92-50f9-34a22d0377b8@anayrat.info
Whole thread Raw
In response to Suggestion about logging only every n-th statement  (Janning Vygen <vygen@kicktipp.de>)
Responses Re: Suggestion about logging only every n-th statement  (Janning Vygen <vygen@kicktipp.de>)
List pgsql-general
On 06/20/2018 01:51 PM, Janning Vygen wrote:
> Back in 2009 I made a suggestion which is not implemented yet but would 
> still be very valuable and easy to implement in my opinion (not for me 
> as I am not speaking C):
> 
>
https://www.postgresql.org/message-id/flat/200903161426.56662.vygen%40kicktipp.de#200903161426.56662.vygen@kicktipp.de
 
> 
> 
> We still can't afford to log each and every statement as we have too 
> many and we don't want to afford more disk performance/space. Therefore 
> we log only statements slower than 50ms.
> 
> But for analyzing usage patterns it would be very nice to have this 
> combined with a sample_rate for logging.
> 
>    logging_sample_rate = n
> 
> So each n-th statement will get logged regardless of execution time.
> 
> What do you think?
> 
> regards
> Janning
> 
> 

Hello Janning,

FYI in made this patch which seems do what you want :

https://www.postgresql.org/message-id/flat/c30ee535-ee1e-db9f-fa97-146b9f62caed%40anayrat.info#c30ee535-ee1e-db9f-fa97-146b9f62caed@anayrat.info


I will add an entry in september's commit fest.

Regards,


pgsql-general by date:

Previous
From: Geoff Winkless
Date:
Subject: Re: Suggestion about logging only every n-th statement
Next
From: Janning Vygen
Date:
Subject: Re: Suggestion about logging only every n-th statement