Re: explain root element for auto-explain - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: explain root element for auto-explain
Date
Msg-id 4A8D4FF4.30108@dunslane.net
Whole thread Raw
In response to Re: explain root element for auto-explain  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: explain root element for auto-explain  (Robert Haas <robertmhaas@gmail.com>)
Re: explain root element for auto-explain  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: explain root element for auto-explain  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers

Andrew Dunstan wrote:
> Bruce Momjian wrote:
>> Are we going to publish an XML DTD for EXPLAIN, or have we already?
>
> Not a DTD, but I am working on an XML Schema (DTDs are a bit yesterday).
>
>

Here is a RelaxNG spec which people might find a bit easier to read. It 
has been autocreated by a little tool called trang, that I used on a 
very large body of explain output that I produced by mangling the 
regression tests (and, incidentally, crashing the server in the result - 
I still have to chase that up).

I have a couple of questions, however. First, in that long list of 
alternatives for a Plan node, can any of them occur more than once? 
Second, we are using Item as a child of both Output and Sort-Key nodes. 
Are they really describing the same thing? And in any case, Item is a 
wonderfully non-informative name, as is Output, for that matter.

BTW - I know this requires tweaking - those xsd:NCName values will 
probably just become text, for example.

cheers

andrew


default namespace = "http://www.postgresql.org/2009/explain"

start =   element explain {     element Query {       Plan,       element Triggers { empty },       element
Total-Runtime{ xsd:decimal }     }   }
 
Plan = element Plan {   (element Actual-Loops { xsd:integer }    | element Actual-Rows { xsd:integer }    | element
Actual-Startup-Time{ xsd:decimal }    | element Actual-Total-Time { xsd:decimal }    | element Alias { text }    |
elementFilter { text }    | element Function-Name { xsd:NCName }    | element Hash-Cond { text }    | element
Index-Name{ xsd:NCName }    | element Join-Filter { text }    | element Join-Type { xsd:NCName }    | element
Merge-Cond{ text }    | element Node-Type { text }    | element One-Time-Filter { text }    | element Output { Item+ }
 | element Parent-Relationship { xsd:NCName }    | element Plan-Rows { xsd:integer }    | element Plan-Width {
xsd:integer}    | element Plans { Plan* }    | element Recheck-Cond { text }    | element Relation-Name { xsd:NCName }
 | element Scan-Direction { xsd:NCName }    | element Schema { xsd:NCName }    | element Sort-Key { Item+ }    |
elementSort-Method { text }    | element Sort-Space-Type { xsd:NCName }    | element Sort-Space-Used { xsd:integer }
|element Startup-Cost { xsd:decimal }    | element Strategy { xsd:NCName }    | element Subplan-Name { text }    |
elementTotal-Cost { xsd:decimal })*,   element Index-Cond { text }? }
 
Item = element Item { text }



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: hot standby - merged up to CVS HEAD
Next
From: Robert Haas
Date:
Subject: Re: explain root element for auto-explain