Re: machine-readable explain output v4 - Mailing list pgsql-hackers

From Csaba Nagy
Subject Re: machine-readable explain output v4
Date
Msg-id 1250088689.26985.71.camel@pcd12478
Whole thread Raw
In response to Re: machine-readable explain output v4  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: machine-readable explain output v4
Re: machine-readable explain output v4
List pgsql-hackers
On Wed, 2009-08-12 at 15:42 +0200, Andrew Dunstan wrote:
> Have you actually looked at a logfile with this in it? A simple 
> stylesheet won't do at all. What you get is not an XML document but a 
> text document with little bits of XML embedded in it. So you would need 
> a program to parse that file and either turn it into a single legal XML 
> document or pass each piece of XML individually to your XSLT processor. 
> Bleah.

I'm pretty sure you will never find a human readable format which is
easily extracted from the logs by a program. But if you format the XML
in a (very human unreadable) one-line-without-breaks format then it will
be a lot easier extracted by a program and formatted at your will.

> And all this because you pose a false dichotomy between correctness and 
> completeness on one hand and human readability on the other. I don't 
> accept that at all. I think we can and should improve human readability 
> without sacrificing anything on the correctness and completeness front. 
> In fact, that also needs improving, and we can do them both at the same 
> time.

I really really doubt that. I would go here on the UNIX approach of
piping the things through the right tools, each one doing a simple and
good job for it's single and well defined purpose. So let the explain
spit out a line of XML without much thought about formatting but
focusing on completeness, making it easy for tools to get that line, and
then let the tools do the formatting depending on what you want to do
with the information. Each part will be simpler than you would put in a
directly human readable XML (if that's possible at all) approach, which
will anyway not cover all the uses and tastes.

> I want to be able to have machine readable explain output, but I also 
> want to be able to browse the logs without wasting more brain cells than 
> necessary and without having to use external tools other than by 
> standard text browser (less). As Pooh Bear said, "Both please!"

I argue that a sufficiently complicated explain output will never be
easily navigated in a text browser, however much you would like it. If
you do a where clause with 100 nested ANDs (which occasionally happens
here), I don't think you'll be able to cleanly show that in a text
browser - it will simply not fit in no matter how you format it. But
using the right GUI tool (even a generic XML one) it would be easy to
just temporarily collapse the whole top AND and have a clean view of the
rest.

Cheers,
Csaba.





pgsql-hackers by date:

Previous
From: Pierre Frédéric Caillaud
Date:
Subject: Re: COPY speedup
Next
From: Csaba Nagy
Date:
Subject: Re: machine-readable explain output v4