aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorFujii Masao <fujii@postgresql.org>2020-12-18 10:49:58 +0900
committerFujii Masao <fujii@postgresql.org>2020-12-18 10:49:58 +0900
commit2e0fedf0362cc964c4dae42258455b6391051e70 (patch)
tree2bbba2f1719e34b628913a2449ab057a99b114f3 /doc/src
parent00f690a239932e477f25120d19b08aacdc30deb7 (diff)
downloadpostgresql-2e0fedf0362cc964c4dae42258455b6391051e70.tar.gz
postgresql-2e0fedf0362cc964c4dae42258455b6391051e70.zip
pg_stat_statements: Track time at which all statistics were last reset.
This commit adds "stats_reset" column into the pg_stat_statements_info view. This column indicates the time at which all statistics in the pg_stat_statements view were last reset. Per discussion, this commit also changes pg_stat_statements_info code so that "dealloc" column is reset at the same time as "stats_reset" is reset, i.e., whenever all pg_stat_statements entries are removed, for the sake of consistency. Previously "dealloc" was reset only when pg_stat_statements_reset(0, 0, 0) is called and was not reset when pg_stat_statements_reset() with non-zero value argument discards all entries. This was confusing. Author: Naoki Nakamichi, Yuki Seino Reviewed-by: Yuki Seino, Kyotaro Horiguchi, Li Japin, Fujii Masao Discussion: https://postgr.es/m/c102cf3180d0ee73c1c5a0f7f8558322@oss.nttdata.com
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/pgstatstatements.sgml18
1 files changed, 15 insertions, 3 deletions
diff --git a/doc/src/sgml/pgstatstatements.sgml b/doc/src/sgml/pgstatstatements.sgml
index 81915ea69bb..126ee31d9fd 100644
--- a/doc/src/sgml/pgstatstatements.sgml
+++ b/doc/src/sgml/pgstatstatements.sgml
@@ -523,6 +523,16 @@
<varname>pg_stat_statements.max</varname> were observed
</para></entry>
</row>
+ <row>
+ <entry role="catalog_table_entry"><para role="column_definition">
+ <structfield>stats_reset</structfield> <type>timestamp with time zone</type>
+ </para>
+ <para>
+ Time at which all statistics in the
+ <structname>pg_stat_statements</structname> view were last reset.
+ </para></entry>
+ </row>
+
</tbody>
</tgroup>
</table>
@@ -549,9 +559,11 @@
specified, the default value <literal>0</literal>(invalid) is used for
each of them and the statistics that match with other parameters will be
reset. If no parameter is specified or all the specified parameters are
- <literal>0</literal>(invalid), it will discard all statistics including
- the statistics that <structname>pg_stat_statements_info</structname>
- displays. By default, this function can only be executed by superusers.
+ <literal>0</literal>(invalid), it will discard all statistics.
+ If all statistics in the <filename>pg_stat_statements</filename>
+ view are discarded, it will also reset the statistics in the
+ <structname>pg_stat_statements_info</structname> view.
+ By default, this function can only be executed by superusers.
Access may be granted to others using <command>GRANT</command>.
</para>
</listitem>