Re: not all pg_stat_database fields reset after pg_stat_reset()

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: tv(at)fuzzy(dot)cz, pgsql-bugs(at)postgresql(dot)org
Subject: Re: not all pg_stat_database fields reset after pg_stat_reset()
Date: 2010-12-11 21:58:47
Message-ID: AANLkTik5A2EPt2c7npJArnSJK3cwUoA5rQJqdpeR3MOO@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, Dec 11, 2010 at 18:31, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> tv(at)fuzzy(dot)cz writes:
>> After calling pg_stat_reset, some of the database stats fields are not
>> actually reset, the value is preserved. I've found the bug is actually in
>> pgstat_recv_resetcounter function, where only some of the
>> PgStat_StatDBEntry fields are reset to 0.
>
>> This is true for those 6 fields:
>
>> n_tuples_returned
>> n_tuples_fetched
>> n_tuples_inserted
>> n_tuples_updated
>> n_tuples_deleted
>> last_autovac_time
>
> Hmm.  I think that not resetting the n_tuples_xxx fields was simply an
> oversight in Magnus' patch that added them,
> http://archives.postgresql.org/pgsql-committers/2007-03/msg00144.php
> Magnus, was this intentional by any chance?

Nope, not that I can recall. Looks like an oversight.

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2010-12-12 20:13:08 Re: not all pg_stat_database fields reset after pg_stat_reset()
Previous Message Tom Lane 2010-12-11 18:03:01 Re: not all pg_stat_database fields reset after pg_stat_reset()