<!-- doc/src/sgml/pgoverexplain.sgml -->
<sect1 id="pgoverexplain" xreflabel="pg_overexplain">
<title>pg_overexplain — allow EXPLAIN to dump even more details</title>
<indexterm zone="pgoverexplain">
<primary>pg_overexplain</primary>
</indexterm>
<para>
The <filename>pg_overexplain</filename> extends <command>EXPLAIN</command>
with new options that provide additional output. It is mostly intended to
assist with debugging of and development of the planner, rather than for
general use. Since this module displays internal details of planner data
structures, it may be necessary to refer to the source code to make sense
of the output. Furthermore, the output is likely to change whenever (and as
often as) those data structures change.
</para>
<sect2 id="pgoverexplain-debug">
<title>EXPLAIN (DEBUG)</title>
<para>
The <literal>DEBUG</literal> option displays miscellaneous information from
the plan tree that is not normally shown because it is not expected to be
of general interest. For each individual plan node, it will display the
following fields. See <literal>Plan</literal> in
<literal>nodes/plannodes.h</literal> for additional documentation of these
fields.
</para>
<itemizedlist>
<listitem>
<para>
<literal>Disabled Nodes</literal>. Normal <command>EXPLAIN</command>
determines whether a node is disabled by checking whether the node's
count of disabled nodes is larger than the sum of the counts for the
underlying nodes. This option shows the raw counter value.
</para>
</listitem>
<listitem>
<para>
<literal>Parallel Safe</literal>. Indicates whether it would be safe for
a plan tree node to appear beneath a <literal>Gather</literal> or
<literal>Gather Merge</literal> node, regardless of whether it is
actually below such a node.
</para>
</listitem>
<listitem>
<para>
<literal>Plan Node ID</literal>. An internal ID number that should be
unique for every node in the plan tree. It is used to coordinate parallel
query activity.
</para>
</listitem>
<listitem>
<para>
<literal>extParam</literal> and <literal>allParam</literal>. Information
about which numbered parameters affect this plan node or its children. In
text mode, these fields are only displayed if they are non-empty sets.
</para>
</listitem>
</itemizedlist>
<para>
Once per query, the <literal>DEBUG</literal> option will display the
following fields. See <literal>PlannedStmt</literal> in
<literal>nodes/plannodes.h</literal> for additional detail.
</para>
<itemizedlist>
<listitem>
<para>
<literal>Command Type</literal>. For example, <literal>select</literal>
or <literal>update</literal>.
</para>
</listitem>
<listitem>
<para>
<literal>Flags</literal>. A comma-separated list of Boolean structure
member names from the <literal>PlannedStmt</literal> that are set to
<literal>true</literal>. It covers the following structure members:
<literal>hasReturning</literal>, <literal>hasModifyingCTE</literal>,
<literal>canSetTag</literal>, <literal>transientPlan</literal>,
<literal>dependsOnRole</literal>, <literal>parallelModeNeeded</literal>.
</para>
</listitem>
<listitem>
<para>
<literal>Subplans Needing Rewind</literal>. Integer IDs of subplans that
may need to be rewound by the