Re: Parsing output of EXPLAIN command in PostgreSQL - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Parsing output of EXPLAIN command in PostgreSQL
Date
Msg-id 17247.1320962369@sss.pgh.pa.us
Whole thread Raw
In response to Re: Parsing output of EXPLAIN command in PostgreSQL  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: Parsing output of EXPLAIN command in PostgreSQL
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> On 11/10/2011 04:29 PM, Robert Haas wrote:
>> 2011/11/10 ���������� ���������<tasosarvanitis@yahoo.gr>:
>>> Is there any other solution I am not aware of?

>> Not that I know of.  I think pgAdmin can parse the EXPLAIN output,
>> too, but that's in C++.

> 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.  If you insist on reading the text format,
don't be surprised when (not if) it breaks in future releases, and don't
expect any sympathy from these quarters.

It really shouldn't be that difficult to come by pre-fab code to read
at least one of XML, JSON, or YAML into a suitable data structure.

Now, if you're looking for something that "understands" the resulting
data structure in more than a superficial fashion, that's a different
question.  But you'd need to get a lot more specific about what you
need it to do.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: const correctness
Next
From: Tom Lane
Date:
Subject: Re: LOCK_DEBUG is busted