On Fri, Feb 11, 2005 at 03:50:05PM +0100, Harald Fuchs wrote:
> In article <20050211115856.GB7055@svana.org>,
> Martijn van Oosterhout <kleptog@svana.org> writes:
> > At the moment people are talking about parsing strings to get the
> > output. That output has the same issues as what's being proposed here,
> > we're just saving the parsing step.
>
> Yes, but whenever I need to parse "prose", I think there's something
> wrong. The textual EXPLAIN output is fine only for short query plans.
I agree. I'm wondering if it is possible to write a function to produce
the alterbate output. I havn't looked at that code in a while.
> > However, tuple based output would be quite unreadable for humans, how
> > can one specify which output to return. EXPLAIN ANALYZE WITH TUPLES
> > query?
>
> Going from tuples to prose is easy; there could be several formatting
> functions for that - maybe even one which outputs the plan in a way
> compatible to Oracle or something else.
>
> If someone's interested, here's my "prose parser" again, now also
> calculating the nesting depth:
<snip>
There's one corner case you need to make sure you handle. In the plan
that started this thread there's a query node marked (never executed).
That will affect yout regex a bit. an that case you should probably
return NULLs. (It might do that, I havn't run the code through
carefully).
Case in point to why it should be an internal function.
Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.