Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 58ad961

Browse files
committed
Add note in pg_stat_statements documentation about planning statistics.
The added note explains that the numbers of planning and execution in the statement are not always expected to match because their statistics are updated at their respective end phase, and only for successful operations. Author: Pascal Legrand, Julien Rouhaud, tweaked a bit by Fujii Masao Discussion: https://postgr.es/m/1585857868967-0.post@n3.nabble.com
1 parent c3e4cba commit 58ad961

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

doc/src/sgml/pgstatstatements.sgml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
<entry><structfield>calls</structfield></entry>
130130
<entry><type>bigint</type></entry>
131131
<entry></entry>
132-
<entry>Number of times executed</entry>
132+
<entry>Number of times the statement was executed</entry>
133133
</row>
134134

135135
<row>
@@ -398,6 +398,16 @@
398398
reducing <varname>pg_stat_statements.max</varname> to prevent
399399
recurrences.
400400
</para>
401+
402+
<para>
403+
<structfield>plans</structfield> and <structfield>calls</structfield> aren't
404+
always expected to match because planning and execution statistics are
405+
updated at their respective end phase, and only for successful operations.
406+
For example, if a statement is successfully planned but fails during
407+
the execution phase, only its planning statistics will be updated.
408+
If planning is skipped because a cached plan is used, only its execution
409+
statistics will be updated.
410+
</para>
401411
</sect2>
402412

403413
<sect2>

0 commit comments

Comments
 (0)