diff options
author | Bruce Momjian <bruce@momjian.us> | 2022-10-17 15:07:02 -0400 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2022-10-17 15:07:02 -0400 |
commit | 6a71bf6f587cddc2129e679fc3ecdd937710245e (patch) | |
tree | 84388cd96000e1cbd75521715149b7e8c893ee34 | |
parent | 65c1106d8c5bea72b30c257d992c0d42f1b52440 (diff) | |
download | postgresql-6a71bf6f587cddc2129e679fc3ecdd937710245e.tar.gz postgresql-6a71bf6f587cddc2129e679fc3ecdd937710245e.zip |
doc: warn pg_stat_reset() can cause vacuum/analyze problems
The fix is to run ANALYZE.
Discussion: https://postgr.es/m/YzRr+ys98UzVQJvK@momjian.us,
https://postgr.es/m/flat/CAKJS1f8DTbCHf9gedU0He6ARsd58E6qOhEHM1caomqj_r9MOiQ%40mail.gmail.com,
https://postgr.es/m/CAKJS1f80o98hcfSk8j%3DfdN09S7Sjz%2BvuzhEwbyQqvHJb_sZw0g%40mail.gmail.com
Backpatch-through: 10
-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 6425e36c85f..6ad4688e38e 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -3339,6 +3339,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 |