pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedSuggestion about logging only every n-th statement
7+ messages / 5 participants
[nested] [flat]
* Suggestion about logging only every n-th statement
@ 2018-06-20 11:51 Janning Vygen <vygen@kicktipp.de>
2018-06-20 12:53 ` Re: Suggestion about logging only every n-th statement Geoff Winkless <pgsqladmin@geoff.dj>
2018-06-20 12:53 ` Re: Suggestion about logging only every n-th statement Adrien NAYRAT <adrien.nayrat@anayrat.info>
2018-06-20 13:08 ` Re: Suggestion about logging only every n-th statement Andreas Kretschmer <andreas@a-kretschmer.de>
0 siblings, 3 replies; 7+ messages in thread
From: Janning Vygen @ 2018-06-20 11:51 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
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...
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
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Suggestion about logging only every n-th statement
2018-06-20 11:51 Suggestion about logging only every n-th statement Janning Vygen <vygen@kicktipp.de>
@ 2018-06-20 12:53 ` Geoff Winkless <pgsqladmin@geoff.dj>
2 siblings, 0 replies; 7+ messages in thread
From: Geoff Winkless @ 2018-06-20 12:53 UTC (permalink / raw)
To: vygen@kicktipp.de; pgsql-general@lists.postgresql.org
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
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Suggestion about logging only every n-th statement
2018-06-20 11:51 Suggestion about logging only every n-th statement Janning Vygen <vygen@kicktipp.de>
@ 2018-06-20 12:53 ` Adrien NAYRAT <adrien.nayrat@anayrat.info>
2018-06-20 13:06 ` Re: Suggestion about logging only every n-th statement Janning Vygen <vygen@kicktipp.de>
2 siblings, 1 reply; 7+ messages in thread
From: Adrien NAYRAT @ 2018-06-20 12:53 UTC (permalink / raw)
To: Janning Vygen <vygen@kicktipp.de>; pgsql-general@lists.postgresql.org
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...
>
>
> 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#c30ee...
I will add an entry in september's commit fest.
Regards,
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Suggestion about logging only every n-th statement
2018-06-20 11:51 Suggestion about logging only every n-th statement Janning Vygen <vygen@kicktipp.de>
2018-06-20 12:53 ` Re: Suggestion about logging only every n-th statement Adrien NAYRAT <adrien.nayrat@anayrat.info>
@ 2018-06-20 13:06 ` Janning Vygen <vygen@kicktipp.de>
2018-06-24 11:35 ` Re: Suggestion about logging only every n-th statement Adrien Nayrat <adrien.nayrat@anayrat.info>
0 siblings, 1 reply; 7+ messages in thread
From: Janning Vygen @ 2018-06-20 13:06 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
Am 20.06.2018 um 14:53 schrieb Adrien NAYRAT:
> 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...
>>
>
> 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#c30ee...
>
>
> I will add an entry in september's commit fest.
excellent. Exactly what I want!
regards
Janning
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Suggestion about logging only every n-th statement
2018-06-20 11:51 Suggestion about logging only every n-th statement Janning Vygen <vygen@kicktipp.de>
2018-06-20 12:53 ` Re: Suggestion about logging only every n-th statement Adrien NAYRAT <adrien.nayrat@anayrat.info>
2018-06-20 13:06 ` Re: Suggestion about logging only every n-th statement Janning Vygen <vygen@kicktipp.de>
@ 2018-06-24 11:35 ` Adrien Nayrat <adrien.nayrat@anayrat.info>
0 siblings, 0 replies; 7+ messages in thread
From: Adrien Nayrat @ 2018-06-24 11:35 UTC (permalink / raw)
To: Janning Vygen <vygen@kicktipp.de>; pgsql-general@lists.postgresql.org
On 06/20/2018 03:06 PM, Janning Vygen wrote:
>> 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#c30ee...
>>
>>
>> I will add an entry in september's commit fest.
>
> excellent. Exactly what I want!
FYI, I added an entry in next commit fest (september is not open) :
https://commitfest.postgresql.org/18/1691/
Feel free to review it ;)
Regards,
--
Adrien NAYRAT
Attachments:
signature.asc (application/pgp-signature, 487B) download
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Suggestion about logging only every n-th statement
2018-06-20 11:51 Suggestion about logging only every n-th statement Janning Vygen <vygen@kicktipp.de>
@ 2018-06-20 13:08 ` Andreas Kretschmer <andreas@a-kretschmer.de>
2018-06-20 21:02 ` Re: Suggestion about logging only every n-th statement Adrien Nayrat <adrien.nayrat@anayrat.info>
2 siblings, 1 reply; 7+ messages in thread
From: Andreas Kretschmer @ 2018-06-20 13:08 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org; Janning Vygen <vygen@kicktipp.de>
On 20 June 2018 13:51:25 CEST, Janning Vygen <vygen@kicktipp.de> 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...
>
>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
I would suggest using of pg_stat_statements for that.
Regards, Andreas
--
2ndQuadrant - The PostgreSQL Support Company
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Suggestion about logging only every n-th statement
2018-06-20 11:51 Suggestion about logging only every n-th statement Janning Vygen <vygen@kicktipp.de>
2018-06-20 13:08 ` Re: Suggestion about logging only every n-th statement Andreas Kretschmer <andreas@a-kretschmer.de>
@ 2018-06-20 21:02 ` Adrien Nayrat <adrien.nayrat@anayrat.info>
0 siblings, 0 replies; 7+ messages in thread
From: Adrien Nayrat @ 2018-06-20 21:02 UTC (permalink / raw)
To: Andreas Kretschmer <andreas@a-kretschmer.de>; pgsql-general@lists.postgresql.org; Janning Vygen <vygen@kicktipp.de>
On 06/20/2018 03:08 PM, Andreas Kretschmer wrote:
> I would suggest using of pg_stat_statements for that.
I agree, but sometimes it is not sufficient. For example, if you need query's
parameters.
--
Adrien NAYRAT
Attachments:
signature.asc (application/pgp-signature, 487B) download
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2018-06-24 11:35 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-06-20 11:51 Suggestion about logging only every n-th statement Janning Vygen <vygen@kicktipp.de>
2018-06-20 12:53 ` Geoff Winkless <pgsqladmin@geoff.dj>
2018-06-20 12:53 ` Adrien NAYRAT <adrien.nayrat@anayrat.info>
2018-06-20 13:06 ` Janning Vygen <vygen@kicktipp.de>
2018-06-24 11:35 ` Adrien Nayrat <adrien.nayrat@anayrat.info>
2018-06-20 13:08 ` Andreas Kretschmer <andreas@a-kretschmer.de>
2018-06-20 21:02 ` Adrien Nayrat <adrien.nayrat@anayrat.info>
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