Re: Get explain output of postgresql in Tables - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Get explain output of postgresql in Tables
Date
Msg-id 19372.1144851078@sss.pgh.pa.us
Whole thread Raw
In response to Re: Get explain output of postgresql in Tables  (Richard Huxton <dev@archonet.com>)
Responses Re: Get explain output of postgresql in Tables  (Richard Huxton <dev@archonet.com>)
Re: Get explain output of postgresql in Tables  ("Greg Sabino Mullane" <greg@turnstep.com>)
List pgsql-hackers
Richard Huxton <dev@archonet.com> writes:
> Jim C. Nasby wrote:
>> Actually, I've been wondering about better ways to handle this. One
>> thought is to come up with a non-human readable format that could easily
>> be cut and pasted into a website that would then provide something easy
>> to understand. Ideally that website could also produce graphical output
>> like pgAdmin does, since that makes it trivially easy to see what the
>> 'critical path' is.

> I actually started putting something like this together about a year 
> ago, but the majority of my time was spent reformatting the text rather 
> than reading the explain.

I dislike the thought of encouraging people to post stuff in a
not-easily-readable format.  They won't do it anyway, if it's not
default; look how we still can't get people to send EXPLAIN ANALYZE
output the first time.

One idea that comes to mind is to work up some trivial little script
that undoes the more common forms of cut-and-paste damage.

I wonder if it would help much just to change EXPLAIN to indent with
something other than spaces?  Maybe instead of

Nested Loop  (cost=1.06..40.43 rows=5 width=244) Join Filter: (public.tenk1.unique2 = int4_tbl.f1) ->  HashAggregate
(cost=1.06..1.11rows=5 width=4)
 

print

Nested Loop  (cost=1.06..40.43 rows=5 width=244)
--Join Filter: (public.tenk1.unique2 = int4_tbl.f1)
----> HashAggregate  (cost=1.06..1.11 rows=5 width=4)

Not sure what would look nice, but this would at least remove the hazard
from stuff that thinks whitespace isn't significant.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Dave Page"
Date:
Subject: Re: plpgsql by default
Next
From: Richard Huxton
Date:
Subject: Re: Get explain output of postgresql in Tables