to the view's <structfield>query</structfield> column will return nulls). This
feature is intended to support external tools that might wish to avoid
the overhead of repeatedly retrieving query texts of indeterminate
length. Such tools can instead cache the first query text observed
for each entry themselves, since that is
all <filename>pg_stat_statements</filename> itself does, and then retrieve
query texts only as needed. Since the server stores query texts in a
file, this approach may reduce physical I/O for repeated examination
of the <structname>pg_stat_statements</structname> data.
</para>
</listitem>
</varlistentry>
</variablelist>
</sect2>
<sect2 id="pgstatstatements-config-params">
<title>Configuration Parameters</title>
<variablelist>
<varlistentry>
<term>
<varname>pg_stat_statements.max</varname> (<type>integer</type>)
<indexterm>
<primary><varname>pg_stat_statements.max</varname> configuration parameter</primary>
</indexterm>
</term>
<listitem>
<para>
<varname>pg_stat_statements.max</varname> is the maximum number of
statements tracked by the module (i.e., the maximum number of rows
in the <structname>pg_stat_statements</structname> view). If more distinct
statements than that are observed, information about the least-executed
statements is discarded. The number of times such information was
discarded can be seen in the
<structname>pg_stat_statements_info</structname> view.
The default value is 5000.
This parameter can only be set at server start.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<varname>pg_stat_statements.track</varname> (<type>enum</type>)
<indexterm>
<primary><varname>pg_stat_statements.track</varname> configuration parameter</primary>
</indexterm>
</term>
<listitem>
<para>
<varname>pg_stat_statements.track</varname> controls which statements
are counted by the module.
Specify <literal>top</literal> to track top-level statements (those issued
directly by clients), <literal>all</literal> to also track nested statements
(such as statements invoked within functions), or <literal>none</literal> to
disable statement statistics collection.
The default value is <literal>top</literal>.
Only superusers can change this setting.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<varname>pg_stat_statements.track_utility</varname> (<type>boolean</type>)
<indexterm>
<primary><varname>pg_stat_statements.track_utility</varname> configuration parameter</primary>
</indexterm>
</term>
<listitem>
<para>
<varname>pg_stat_statements.track_utility</varname> controls whether
utility commands are tracked by the module. Utility commands are
all those other than <command>SELECT</command>, <command>INSERT</command>,
<command>UPDATE</command>, <command>DELETE</command>, and <command>MERGE</command>.
The default value is <literal>on</literal>.
Only superusers can change this setting.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<varname>pg_stat_statements.track_planning</varname> (<type>boolean</type>)
<indexterm>
<primary><varname>pg_stat_statements.track_planning</varname> configuration parameter</primary>
</indexterm>
</term>
<listitem>
<para>
<varname>pg_stat_statements.track_planning</varname> controls whether
planning operations and duration are tracked by the module.
Enabling this parameter may incur a noticeable performance penalty,
especially when statements with identical query structure are executed
by many concurrent connections which compete to update a small number of
<structname>pg_stat_statements</structname> entries.
The default