Re: How to identify whether the stats were reset?

From: Tomas Vondra <tv(at)fuzzy(dot)cz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to identify whether the stats were reset?
Date: 2010-11-19 14:09:41
Message-ID: 4CE68525.8010303@fuzzy.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dne 19.11.2010 05:56, Tom Lane napsal(a):
> Tomas Vondra <tv(at)fuzzy(dot)cz> writes:
>> We need to identify whether the stats were reset between the snapshots,
>> because then the collected data are useless (and the scripts that do the
>> analysis are quite confused).
>
> The stats are never reset automatically.

That's true since 8.3 where you removed that feature ;-) but I'd like to
collect data from older versions too. Yes, I know the default value for
that setting used to be 'off' and it's simple to change it.

Anyway it's quite simple to deal with restarts of the whole db, so this
is not a problem.

> If you have a DBA who randomly resets them, fire him ;-)

Well, to do that you need two things. First you have to be a boss, so
that you have the power to fire him (and that's not my case). Second you
have to be able to identify that the stats were actually reset, and
that's what I can't do right now.

Anyway resets do happen, and I need to deal with them (as elegantly as I
can). I don't want to ignore them.

I can identify when all the stats were reset using pg_stat_reset() -
comparing n_commits seems like a quite reliable check. But what about
pg_stat_reset_single_table_counters?

regards
Tomas

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dave Page 2010-11-19 14:43:34 Re: Forums at postgresql.com.au
Previous Message Matthew Walden 2010-11-19 13:37:07 Re: tablespace restore