Re: Parsing output of EXPLAIN command in PostgreSQL

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Αναστάσιος Αρβανίτης <tasosarvanitis(at)yahoo(dot)gr>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Parsing output of EXPLAIN command in PostgreSQL
Date: 2011-11-10 23:23:01
Message-ID: 4EBC5CD5.2050109@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/10/2011 04:59 PM, Tom Lane wrote:
> Andrew Dunstan<andrew(at)dunslane(dot)net> writes:
>
>> Pg--Explain is extremely well written, and should be easily translatable
>> to Java if you really need to. The whole thing is less than 2000 lines,
>> and a large part of that is comments.
> Nonetheless, it's solving the wrong problem. Any program that is being
> written today to read EXPLAIN output should be written to read one of
> the machine-readable formats.
>

Umm, it *does* handle all the formats:

$ wc -l ../Pg--Explain/lib/Pg/Explain.pm ../Pg--Explain/lib/Pg/Explain/*
248 ../Pg--Explain/lib/Pg/Explain.pm
75 ../Pg--Explain/lib/Pg/Explain/FromJSON.pm
182 ../Pg--Explain/lib/Pg/Explain/From.pm
202 ../Pg--Explain/lib/Pg/Explain/FromText.pm
109 ../Pg--Explain/lib/Pg/Explain/FromXML.pm
77 ../Pg--Explain/lib/Pg/Explain/FromYAML.pm
785 ../Pg--Explain/lib/Pg/Explain/Node.pm
292 ../Pg--Explain/lib/Pg/Explain/StringAnonymizer.pm
1970 total

One of the obvious reasons for handling text is to deal with old servers
before we had machine readable output.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2011-11-10 23:30:21 Re: Parsing output of EXPLAIN command in PostgreSQL
Previous Message Tom Lane 2011-11-10 23:12:13 Re: proposal: psql concise mode