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

From Geoff Winkless
Subject Re: Suggestion about logging only every n-th statement
Date
Msg-id CAEzk6ffqPUcdQb6SVMkE2ROEJ-SyYg+zKroDV-RGG54S4iuixw@mail.gmail.com
Whole thread Raw
In response to Suggestion about logging only every n-th statement  (Janning Vygen <vygen@kicktipp.de>)
List pgsql-general
On Wed, 20 Jun 2018 at 12:51, Janning Vygen <vygen@kicktipp.de> wrote:
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.

I think you would need to introduce a randomizing element ​if you wanted to make it statistically valid. Logging every n'th statement could (depending on your usage pattern) be catastrophically inaccurate.

Geoff

pgsql-general by date:

Previous
From: Łukasz Jarych
Date:
Subject: Using DSN Connection and knowing windows username
Next
From: Adrien NAYRAT
Date:
Subject: Re: Suggestion about logging only every n-th statement