Re: Auto explain after query timeout - Mailing list pgsql-hackers

From Gurjeet
Subject Re: Auto explain after query timeout
Date
Msg-id CN1FKHTRVPFK.1DU7FO0B3XG0R@gurjeet-personal.lan
Whole thread Raw
In response to Auto explain after query timeout  (James Coleman <jtc331@gmail.com>)
Responses Re: Auto explain after query timeout
List pgsql-hackers
On Tue Sep 20, 2022 at 10:34 AM PDT, James Coleman wrote:
> Hopefully I'm not missing something obvious, but as far as I know
> there's no way to configure auto explain to work fire
> statement_timeout fires.

I believe you're correct.

> I'd like to look into this at some point, but I'm wondering if anyone
> has thought about it before, and, if so, is there any obvious
> impediment to doing so?

This would be a neat feature. Since the changes would be fairly
localized to the contrib module, this would be a great first patch for
someone new to contributing.

This can be exposed at a new GUC auto_explain.log_on_statement_timeout.
I wish our conventions allowed for creating hierarchies of GUC
parameters, e.g. auto_explain.when.statmeent_timeout.

For someone who would like to achieve this in the field today, I believe
they can set auto_explain.log_min_duration equal to, or less than,
statement_timeout.

Best regards,
Gurjeet
http://Gurje.et



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: predefined role(s) for VACUUM and ANALYZE
Next
From: Nathan Bossart
Date:
Subject: Re: XMAX_LOCK_ONLY and XMAX_COMMITTED (fk/multixact code)