proposal - queryid can be used as filter for auto_explain

Started by Pavel Stehule4 days ago4 messageshackers
Jump to latest
#1Pavel Stehule
pavel.stehule@gmail.com

Hi

I have to investigate strange behaviour of some specific query. One
possibility is non stability of plan. This is a bigger server with a bigger
load, and I am a little bit afraid to use auto_explain for all queries.

Currently auto_explain doesn't support it, but it can be practical if we
can specify a list of queryid as a filter of auto_explain.

What do you think about this idea?

Regards

Pavel

#2Julien Rouhaud
rjuju123@gmail.com
In reply to: Pavel Stehule (#1)
Re: proposal - queryid can be used as filter for auto_explain

Hi,

On Mon, Apr 13, 2026 at 06:46:24AM +0200, Pavel Stehule wrote:

I have to investigate strange behaviour of some specific query. One
possibility is non stability of plan. This is a bigger server with a bigger
load, and I am a little bit afraid to use auto_explain for all queries.

Currently auto_explain doesn't support it, but it can be practical if we
can specify a list of queryid as a filter of auto_explain.

What do you think about this idea?

+1. I don't think it's something that will be useful very often, but when it's
going to be useful it would be *extremely* convenient to have.

#3Jakub Wartak
jakub.wartak@enterprisedb.com
In reply to: Julien Rouhaud (#2)
Re: proposal - queryid can be used as filter for auto_explain

On Mon, Apr 13, 2026 at 11:02 AM Julien Rouhaud <rjuju123@gmail.com> wrote:

Hi,

On Mon, Apr 13, 2026 at 06:46:24AM +0200, Pavel Stehule wrote:

I have to investigate strange behaviour of some specific query. One
possibility is non stability of plan. This is a bigger server with a bigger
load, and I am a little bit afraid to use auto_explain for all queries.

Currently auto_explain doesn't support it, but it can be practical if we
can specify a list of queryid as a filter of auto_explain.

What do you think about this idea?

+1. I don't think it's something that will be useful very often, but when it's
going to be useful it would be *extremely* convenient to have.

+1 too.

The only doubt would be: if that's new GUC, then this is list of queryIDs,
right? So do you plan also logging the queryid from auto_explain directly or
one should have %Q in log_line_prefix?

-J.

#4Pavel Stehule
pavel.stehule@gmail.com
In reply to: Jakub Wartak (#3)
Re: proposal - queryid can be used as filter for auto_explain

st 15. 4. 2026 v 8:37 odesílatel Jakub Wartak <jakub.wartak@enterprisedb.com>
napsal:

On Mon, Apr 13, 2026 at 11:02 AM Julien Rouhaud <rjuju123@gmail.com>
wrote:

Hi,

On Mon, Apr 13, 2026 at 06:46:24AM +0200, Pavel Stehule wrote:

I have to investigate strange behaviour of some specific query. One
possibility is non stability of plan. This is a bigger server with a

bigger

load, and I am a little bit afraid to use auto_explain for all queries.

Currently auto_explain doesn't support it, but it can be practical if

we

can specify a list of queryid as a filter of auto_explain.

What do you think about this idea?

+1. I don't think it's something that will be useful very often, but

when it's

going to be useful it would be *extremely* convenient to have.

+1 too.

The only doubt would be: if that's new GUC, then this is list of queryIDs,
right? So do you plan also logging the queryid from auto_explain directly
or
one should have %Q in log_line_prefix?

I plan a new GUC with a list of values. I haven't thought about
implementation yet. I'll send a prototype next week.

Regards

Pavel

Show quoted text

-J.