pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: tv@fuzzy.cz
Cc: pgsql-bugs@postgresql.org
Cc: Magnus Hagander <magnus@hagander.net>
Subject: Re: not all pg_stat_database fields reset after pg_stat_reset()
Date: Sat, 11 Dec 2010 12:31:31 -0500
Message-ID: <4350.1292088691@sss.pgh.pa.us> (raw)
In-Reply-To: <4e19b0bfc836f7002752517e7792a0b9.squirrel@sq.gransy.com>
References: <4e19b0bfc836f7002752517e7792a0b9.squirrel@sq.gransy.com>

tv@fuzzy.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?

However, I disagree with resetting last_autovac_time ... that's not a
counter, so there's no particularly good reason to discard its value.

			regards, tom lane



view thread (6+ messages)  latest in thread

Message-ID: <4350.1292088691@sss.pgh.pa.us>
Permalink:  ../4350.1292088691@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4350.1292088691@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, tv@fuzzy.cz, magnus@hagander.net
  Subject: Re: not all pg_stat_database fields reset after pg_stat_reset()
  In-Reply-To: <4350.1292088691@sss.pgh.pa.us>
  References: <4e19b0bfc836f7002752517e7792a0b9.squirrel@sq.gransy.com> <4350.1292088691@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox