diff options
author | Bruce Momjian | 2022-10-17 19:07:03 +0000 |
---|---|---|
committer | Bruce Momjian | 2022-10-17 19:07:03 +0000 |
commit | 4d070469c19f85043293789c570dbe8fb41ab1bb (patch) | |
tree | bde28ff1bc5415cc96fce8a4d92e1f093db41eea /doc | |
parent | 8272749e8ca1dbbcb5f8cf5632ec26a573ac3111 (diff) |
doc: warn pg_stat_reset() can cause vacuum/analyze problems
The fix is to run ANALYZE.
Discussion: https://postgr.es/m/[email protected],
https://postgr.es/m/flat/CAKJS1f8DTbCHf9gedU0He6ARsd58E6qOhEHM1caomqj_r9MOiQ%40mail.gmail.com,
https://postgr.es/m/CAKJS1f80o98hcfSk8j%3DfdN09S7Sjz%2BvuzhEwbyQqvHJb_sZw0g%40mail.gmail.com
Backpatch-through: 10
Diffstat (limited to 'doc')
-rw-r--r-- | doc/src/sgml/monitoring.sgml | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index 60a2026b0b0..e5d622d5147 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -5510,6 +5510,17 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i </tgroup> </table> + <warning> + <para> + Using <function>pg_stat_reset()</function> also resets counters that + autovacuum uses to determine when to trigger a vacuum or an analyze. + Resetting these counters can cause autovacuum to not perform necessary + work, which can cause problems such as table bloat or out-dated + table statistics. A database-wide <command>ANALYZE</command> is + recommended after the statistics have been reset. + </para> + </warning> + <para> <function>pg_stat_get_activity</function>, the underlying function of the <structname>pg_stat_activity</structname> view, returns a set of records |