summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane2009-08-10 05:46:50 +0000
committerTom Lane2009-08-10 05:46:50 +0000
commit9bd27b7c9e998087f390774bd0f43916813a2847 (patch)
treeee2b7fa2b2e77c53c87a53a786163dae1b0e6538 /doc/src
parent18894c401f1f5ec5af1d08a12da1f183599e8560 (diff)
Extend EXPLAIN to support output in XML or JSON format.
There are probably still some adjustments to be made in the details of the output, but this gets the basic structure in place. Robert Haas
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/auto-explain.sgml20
-rw-r--r--doc/src/sgml/ref/explain.sgml28
2 files changed, 41 insertions, 7 deletions
diff --git a/doc/src/sgml/auto-explain.sgml b/doc/src/sgml/auto-explain.sgml
index c1e85af10e0..72487f944ce 100644
--- a/doc/src/sgml/auto-explain.sgml
+++ b/doc/src/sgml/auto-explain.sgml
@@ -1,4 +1,4 @@
-<!-- $PostgreSQL: pgsql/doc/src/sgml/auto-explain.sgml,v 1.3 2009/01/02 01:16:02 tgl Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/auto-explain.sgml,v 1.4 2009/08/10 05:46:50 tgl Exp $ -->
<sect1 id="auto-explain">
<title>auto_explain</title>
@@ -104,6 +104,24 @@ LOAD 'auto_explain';
<varlistentry>
<term>
+ <varname>auto_explain.log_format</varname> (<type>enum</type>)
+ </term>
+ <indexterm>
+ <primary><varname>auto_explain.log_format</> configuration parameter</primary>
+ </indexterm>
+ <listitem>
+ <para>
+ <varname>auto_explain.log_format</varname> selects the
+ <command>EXPLAIN</> output format to be used.
+ The allowed values are <literal>text</literal>, <literal>xml</literal>,
+ and <literal>json</literal>. The default is text.
+ Only superusers can change this setting.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>
<varname>auto_explain.log_nested_statements</varname> (<type>boolean</type>)
</term>
<indexterm>
diff --git a/doc/src/sgml/ref/explain.sgml b/doc/src/sgml/ref/explain.sgml
index d3b5c979a29..9670bd06f19 100644
--- a/doc/src/sgml/ref/explain.sgml
+++ b/doc/src/sgml/ref/explain.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/explain.sgml,v 1.45 2009/07/26 23:34:17 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/explain.sgml,v 1.46 2009/08/10 05:46:50 tgl Exp $
PostgreSQL documentation
-->
@@ -31,7 +31,7 @@ PostgreSQL documentation
<refsynopsisdiv>
<synopsis>
-EXPLAIN [ ( { ANALYZE <replaceable class="parameter">boolean</replaceable> | VERBOSE <replaceable class="parameter">boolean</replaceable> | COSTS <replaceable class="parameter">boolean</replaceable> } [, ...] ) ] <replaceable class="parameter">statement</replaceable>
+EXPLAIN [ ( { ANALYZE <replaceable class="parameter">boolean</replaceable> | VERBOSE <replaceable class="parameter">boolean</replaceable> | COSTS <replaceable class="parameter">boolean</replaceable> | FORMAT { TEXT | XML | JSON } } [, ...] ) ] <replaceable class="parameter">statement</replaceable>
EXPLAIN [ ANALYZE ] [ VERBOSE ] <replaceable class="parameter">statement</replaceable>
</synopsis>
</refsynopsisdiv>
@@ -109,7 +109,7 @@ ROLLBACK;
<listitem>
<para>
Carry out the command and show the actual run times. This
- parameter defaults to <command>FALSE</command>.
+ parameter defaults to <literal>FALSE</literal>.
</para>
</listitem>
</varlistentry>
@@ -118,8 +118,12 @@ ROLLBACK;
<term><literal>VERBOSE</literal></term>
<listitem>
<para>
- Include the output column list for each node in the plan tree. This
- parameter defaults to <command>FALSE</command>.
+ Display additional information regarding the plan. Specifically, include
+ the output column list for each node in the plan tree, schema-qualify
+ table and function names, always label variables in expressions with
+ their range table alias, and always print the name of each trigger for
+ which statistics are displayed. This parameter defaults to
+ <literal>FALSE</literal>.
</para>
</listitem>
</varlistentry>
@@ -130,7 +134,19 @@ ROLLBACK;
<para>
Include information on the estimated startup and total cost of each
plan node, as well as the estimated number of rows and the estimated
- width of each row. This parameter defaults to <command>TRUE</command>.
+ width of each row. This parameter defaults to <literal>TRUE</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>FORMAT</literal></term>
+ <listitem>
+ <para>
+ Specify the output format, which can be TEXT, XML, or JSON.
+ XML or JSON output contains the same information as the text output
+ format, but is easier for programs to parse. This parameter defaults to
+ <literal>TEXT</literal>.
</para>
</listitem>
</varlistentry>