Re: Making auto_explain more useful / convenient - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Making auto_explain more useful / convenient
Date
Msg-id 1552828.1699717777@sss.pgh.pa.us
Whole thread Raw
In response to Making auto_explain more useful / convenient  (Vladimir Churyukin <vladimir@churyukin.com>)
Responses Re: Making auto_explain more useful / convenient
List pgsql-hackers
Vladimir Churyukin <vladimir@churyukin.com> writes:
> Why not have an option to return EXPLAIN results as a NoticeResponse
> instead? That would make its usage more convenient.

That seems quite useless to me, and likely actually counterproductive.
If you are manually investigating query performance, you can just use
EXPLAIN directly.  The point of auto_explain, ISTM, is to capture info
about queries issued by automated applications.  So something like the
above could only work if you taught every one of your applications to
capture the NOTICE output, separate it from random other NOTICE
output, and then (probably) log it somewhere central for later
inspection.  That's a lot of code to write, and at the end you'd
only have effectively duplicated existing tooling such as pgbadger.
Also, what happens in applications you forgot to convert?

> Another thing is tangentially related...
> I think it may be good to have a number of options to generate
> significantly shorter output similar to EXPLAIN. EXPLAIN is great, but
> sometimes people need more concise and specific information, for example
> total number of buffers and reads by certain query (this is pretty common),
> whether or not we had certain nodes in the plan (seq scan, scan of certain
> index(es)), how bad was cardinality misprediction on certain nodes, etc.

Maybe, but again I'm a bit skeptical.  IME you frequently don't know
what you're looking for until you've seen the bigger picture.  Zeroing
in on details like this could be pretty misleading.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: pg_basebackup check vs Windows file path limits
Next
From: Vladimir Churyukin
Date:
Subject: Re: Making auto_explain more useful / convenient