On Wed, Dec 2, 2009 at 4:24 PM, Tom Lane <t...@sss.pgh.pa.us> wrote:
> Ron Mayer <rm...@cheapcomplexdevices.com> writes:
>> Tom Lane wrote:
>>> Hmm.  So the argument for it is "let's make a machine-readable format
>>> more human-readable"?  I'm not getting the point.  People should look
>>> at the regular text output.
>
>> IMHO YAML beats the regular text format for human-readability -
>> at least for people with narrow terminal windows, and for novices.
>> Greg posted examples comparing regular-text vs yaml vs json here:
>> http://archives.postgresql.org/pgsql-hackers/2009-08/msg02090.php
>
> Mph.  Maybe I've been looking at the traditional format too long,
> but I don't find the YAML version better --- it's so verbose that
> you could only see a small fraction of a query at a time.

I've been thinking about this a little more and I think I am going to
vote (if I get a vote) to reject this patch.  I think Andrew hit the
crucial point upthread: the latest version of YAML is a superset of
JSON, which means that the only possible use cases for this patch are:

- people using older YAML parsers that can't handle the latest version
(because if they can handle the latest version then they can just use
that on the existing JSON format), and
- people who want to use the YAML format as a substitute for text
format on grounds of readability.

The first target doesn't seem worth aiming at.  Admittedly the latest
version of the YAML 1.2 spec - whose stated goal is JSON-compatibilty
- is only two months old, so there may be many YAML users who don't
have parsers that are completely JSON-compatible.  But presumably this
problem will resolve itself over time.

With respect to the second one, I am not going to argue that the
current text format is ideal in all ways.  In particular, on complex
plans, I find it difficult to match up the plans for the inner and
outer sides of any given node, which may be far enough apart
vertically that it's difficult to tell exactly which bits are in the
same column.  Furthermore, the main output row for each node is wider
than I would like, especially when using EXPLAIN ANALYZE.  Even on
relatively simple plans, I have to maximize my terminal window to
forestall wrapping, and on complex plans, wrapping is inevitable even
if I do maximize the window.  For all of that, in the nearly-two-years
I've been reading pgsql-hackers, I can't remember one complaint about
the visual presentation of the EXPLAIN output.  It's possible that my
memory is faulty, but I think I would remember if there had been very
many.

On top of that, if you did want YAML for easier readability, what
aspect of the output is more readable in YAML than it is in text
format?  The only answer I can think of is that you like having each
data element on a separate line, so that the plan is much longer but
somewhat narrower.  But if that's what you want, the JSON output is
almost as good - the only difference is a bit of extra punctuation.

...Robert

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to