Re: Should the docs have a warning about pg_stat_reset()? - Mailing list pgsql-hackers

From David Rowley
Subject Re: Should the docs have a warning about pg_stat_reset()?
Date
Msg-id CAKJS1f92xUWun6tarsA8iioE1H-_a=67MkKZLf663Ywgf2_=zQ@mail.gmail.com
Whole thread Raw
In response to Re: Should the docs have a warning about pg_stat_reset()?  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
On Thu, 11 Apr 2019 at 06:52, Bruce Momjian <bruce@momjian.us> wrote:
>
> OK, let me step back.  Why are people resetting the statistics
> regularly?  Based on that purpose, does it make sense to clear the
> stats that effect autovacuum?

I can't speak for everyone, but once upon a time when I first started
using PostgreSQL, to monitor the application's use of the database I
recorded the output of pg_stat_user_tables once per day and then reset
the statistics.  It was useful to know the number of inserted tuples,
seq scans, index scans etc so I could understand the load on the
database better.   Of course, nowadays with LEAD()/LAG() it's pretty
easy to find the difference from the previous day. I'd have done it
differently if those had existed back then.

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: [PATCH v20] GSSAPI encryption support
Next
From: "Iwata, Aya"
Date:
Subject: RE: Contribution to Perldoc for TestLib module in Postgres