1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Add TIMING option to EXPLAIN, to allow eliminating of timing overhead.

Sometimes it may be useful to get actual row counts out of EXPLAIN
(ANALYZE) without paying the cost of timing every node entry/exit.
With this patch, you can say EXPLAIN (ANALYZE, TIMING OFF) to get that.

Tomas Vondra, reviewed by Eric Theise, with minor doc changes by me.
This commit is contained in:
Robert Haas
2012-02-07 11:23:04 -05:00
parent 1631598ea2
commit af7914c662
6 changed files with 98 additions and 23 deletions

View File

@ -40,6 +40,7 @@ EXPLAIN [ ANALYZE ] [ VERBOSE ] <replaceable class="parameter">statement</replac
VERBOSE [ <replaceable class="parameter">boolean</replaceable> ]
COSTS [ <replaceable class="parameter">boolean</replaceable> ]
BUFFERS [ <replaceable class="parameter">boolean</replaceable> ]
TIMING [ <replaceable class="parameter">boolean</replaceable> ]
FORMAT { TEXT | XML | JSON | YAML }
</synopsis>
</refsynopsisdiv>
@ -171,6 +172,21 @@ ROLLBACK;
</listitem>
</varlistentry>
<varlistentry>
<term><literal>TIMING</literal></term>
<listitem>
<para>
Include the actual startup time and time spent in the node in the output.
The overhead of repeatedly reading the system clock can slow down the
query significantly on some systems, so it may be useful to set this
parameter to <literal>FALSE</literal> when only actual row counts, and not
exact times, are needed.
This parameter may only be used when <literal>ANALYZE</literal> is also
enabled. It defaults to <literal>TRUE</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>FORMAT</literal></term>
<listitem>