explain root element for auto-explain

From: Andrew Dunstan <andrew(dot)dunstan(at)pgexperts(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: explain root element for auto-explain
Date: 2009-08-17 21:43:56
Message-ID: 4A89CF1C.7010004@pgexperts.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


The attached tiny patch sets the <explain> root element for auto-explain
XML output, so it looks something like this:

<explain xmlns="http://www.postgresql.org/2009/explain">
<Plan>
<Node-Type>Result</Node-Type>
<Startup-Cost>0.00</Startup-Cost>
<Total-Cost>0.01</Total-Cost>
<Plan-Rows>1</Plan-Rows>
<Plan-Width>0</Plan-Width>
</Plan>
</explain>

The JSON output looks like this:

[
"Plan": {
"Node Type": "Result",
"Startup Cost": 0.00,
"Total Cost": 0.01,
"Plan Rows": 1,
"Plan Width": 0
}
]

This is worth doing in itself in the XML case for reasons previously
explained, but it also makes it relatively easy to add a Query-Text node
or some such to the structured output, which is very much worth having,
and would be my next proposed step.

cheers

andrew

Attachment Content-Type Size
explain-root.patch text/x-patch 2.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2009-08-17 21:54:15 Re: 8.5 development schedule
Previous Message Peter Eisentraut 2009-08-17 21:39:55 Re: 8.5 development schedule