summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/config.sgml25
-rw-r--r--doc/src/sgml/pgstatstatements.sgml20
2 files changed, 44 insertions, 1 deletions
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index e51639d56c7..9d846cb7be0 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -7622,6 +7622,31 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
<title>Statistics Monitoring</title>
<variablelist>
+ <varlistentry id="guc-compute-query-id" xreflabel="compute_query_id">
+ <term><varname>compute_query_id</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>compute_query_id</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Enables in-core computation of a query identifier. The <xref
+ linkend="pgstatstatements"/> extension requires a query identifier
+ to be computed. Note that an external module can alternatively
+ be used if the in-core query identifier computation method
+ isn't acceptable. In this case, in-core computation should
+ remain disabled. The default is <literal>off</literal>.
+ </para>
+ <note>
+ <para>
+ To ensure that a only one query identifier is calculated and
+ displayed, extensions that calculate query identifiers should
+ throw an error if a query identifier has already been computed.
+ </para>
+ </note>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term><varname>log_statement_stats</varname> (<type>boolean</type>)
<indexterm>
diff --git a/doc/src/sgml/pgstatstatements.sgml b/doc/src/sgml/pgstatstatements.sgml
index 464bf0e5aed..3ca292d71fb 100644
--- a/doc/src/sgml/pgstatstatements.sgml
+++ b/doc/src/sgml/pgstatstatements.sgml
@@ -21,6 +21,14 @@
</para>
<para>
+ The module will not track statistics unless query
+ identifiers are calculated. This can be done by enabling <xref
+ linkend="guc-compute-query-id"/> or using a third-party module that
+ computes its own query identifiers. Note that all statistics tracked
+ by this module must be reset if the query identifier method is changed.
+ </para>
+
+ <para>
When <filename>pg_stat_statements</filename> is loaded, it tracks
statistics across all databases of the server. To access and manipulate
these statistics, the module provides views
@@ -84,7 +92,7 @@
<structfield>queryid</structfield> <type>bigint</type>
</para>
<para>
- Internal hash code, computed from the statement's parse tree
+ Hash code to identify identical normalized queries.
</para></entry>
</row>
@@ -386,6 +394,16 @@
are compared strictly on the basis of their textual query strings, however.
</para>
+ <note>
+ <para>
+ The following details about constant replacement and
+ <structfield>queryid</structfield> only applies when <xref
+ linkend="guc-compute-query-id"/> is enabled. If you use an external
+ module instead to compute <structfield>queryid</structfield>, you
+ should refer to its documentation for details.
+ </para>
+ </note>
+
<para>
When a constant's value has been ignored for purposes of matching the query
to other queries, the constant is replaced by a parameter symbol, such