Re: machine-readable explain output v4

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: machine-readable explain output v4
Date: 2009-08-10 20:28:01
Message-ID: 603c8f070908101328n37c37a44nebe5a7c3412ad42a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 10, 2009 at 1:45 PM, Tom Lane<tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> I may be thick as a post here and say "oh, I'm a moron" when you
>> explain this to me, but I still don't understand why that would
>> require the XML notation to interpose an intermediate node.  Why can't
>> "filter" node itself can be the labelled container?
>
> Filter isn't a node; it's a property of the containing Plan node.

My use of the word node was poorly chosen, since that word has a
specific meaning in the context of PG.

> The way we have this set up, there's a distinction between properties
> and groups, which AFAICS we have to have in order to have directly
> comparable structures in XML and JSON.  Didn't you design this
> yourself?

Yes, I did. But the point is that as far as I can see, the following
two things are equivalent:

<Filter><Text>(f1 &gt; 0)</Text></Filter>
"Filter": { "Text": "(f1 > 0)" }

And this is not:

<Filter><Expr><Text>(f1 &gt; 0)</Text></Expr></Filter>

The latter would be equivalent to something like this in JSON:

"Filter" : { "Expr" : { "Text: "(f1 > 0)" } }

or if you intended the <Expr> thing to be an array-type container,
then it would be equivalent to this:

"Filter" : { [ { "Text: "(f1 > 0)" } ] }

Would it be helpful for me to try to reduce this to code?

> (I think part of the issue is that containers in JSON are anonymous
> whereas XML wants to assign them a named type.  That's fine with me,
> in fact the JSON approach looks rather impoverished.)

That does make things a little tricky, though it has the virtue of
mapping nicely onto data structures other than XML.

...Robert

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-08-10 20:31:43 Re: pgsql: Refactor NUM_cache_remove calls in error report path to a PG_TRY
Previous Message Tom Lane 2009-08-10 20:26:21 Re: Patch for 8.5, transformationHook