mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
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
This commit is contained in:
@@ -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>
|
||||
|
Reference in New Issue
Block a user