mirror of
https://github.com/postgres/postgres.git
synced 2025-12-21 05:21:08 +03:00
Invent SERIALIZE option for EXPLAIN.
EXPLAIN (ANALYZE, SERIALIZE) allows collection of statistics about the volume of data emitted by a query, as well as the time taken to convert the data to the on-the-wire format. Previously there was no way to investigate this without actually sending the data to the client, in which case network transmission costs might swamp what you wanted to see. In particular this feature allows investigating the costs of de-TOASTing compressed or out-of-line data during formatting. Stepan Rutz and Matthias van de Meent, reviewed by Tomas Vondra and myself Discussion: https://postgr.es/m/ca0adb0e-fa4e-c37e-1cd7-91170b18cae1@gmx.de
This commit is contained in:
@@ -41,6 +41,7 @@ EXPLAIN [ ( <replaceable class="parameter">option</replaceable> [, ...] ) ] <rep
|
||||
SETTINGS [ <replaceable class="parameter">boolean</replaceable> ]
|
||||
GENERIC_PLAN [ <replaceable class="parameter">boolean</replaceable> ]
|
||||
BUFFERS [ <replaceable class="parameter">boolean</replaceable> ]
|
||||
SERIALIZE [ { NONE | TEXT | BINARY } ]
|
||||
WAL [ <replaceable class="parameter">boolean</replaceable> ]
|
||||
TIMING [ <replaceable class="parameter">boolean</replaceable> ]
|
||||
SUMMARY [ <replaceable class="parameter">boolean</replaceable> ]
|
||||
@@ -206,6 +207,34 @@ ROLLBACK;
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><literal>SERIALIZE</literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Include information on the cost
|
||||
of <firstterm>serializing</firstterm> the query's output data, that
|
||||
is converting it to text or binary format to send to the client.
|
||||
This can be a significant part of the time required for regular
|
||||
execution of the query, if the datatype output functions are
|
||||
expensive or if <acronym>TOAST</acronym>ed values must be fetched
|
||||
from out-of-line storage. <command>EXPLAIN</command>'s default
|
||||
behavior, <literal>SERIALIZE NONE</literal>, does not perform these
|
||||
conversions. If <literal>SERIALIZE TEXT</literal>
|
||||
or <literal>SERIALIZE BINARY</literal> is specified, the appropriate
|
||||
conversions are performed, and the time spent doing so is measured
|
||||
(unless <literal>TIMING OFF</literal> is specified). If
|
||||
the <literal>BUFFERS</literal> option is also specified, then any
|
||||
buffer accesses involved in the conversions are counted too.
|
||||
In no case, however, will <command>EXPLAIN</command> actually send
|
||||
the resulting data to the client; hence network transmission costs
|
||||
cannot be investigated this way.
|
||||
Serialization may only be enabled when <literal>ANALYZE</literal> is
|
||||
also enabled. If <literal>SERIALIZE</literal> is written without an
|
||||
argument, <literal>TEXT</literal> is assumed.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><literal>WAL</literal></term>
|
||||
<listitem>
|
||||
|
||||
Reference in New Issue
Block a user