Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 119B41337B47 for ; Thu, 21 Apr 2011 04:51:22 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 85301-09 for ; Thu, 21 Apr 2011 07:51:14 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from out1.mail.amis.hr (out1.mail.amis.hr [188.129.0.4]) by mail.postgresql.org (Postfix) with ESMTP id BD6E9133798E for ; Thu, 21 Apr 2011 04:51:14 -0300 (ADT) Received: from out.fsec.sm.srv.amis.hr (out.fsec.sm.srv.amis.hr [192.168.106.22]) by out1.mail.amis.hr (Postfix) with ESMTP id C60D62002B for ; Thu, 21 Apr 2011 09:51:12 +0200 (CEST) Received: from pps.filterd (out [127.0.0.1]) by out.fsec.sm.srv.amis.hr (8.14.3/8.14.3) with SMTP id p3L7hocY010905 for ; Thu, 21 Apr 2011 09:51:12 +0200 Received: from smtp.amis.hr (smtp.sm.srv.amis.hr [192.168.106.39]) by out.fsec.sm.srv.amis.hr with ESMTP id vtg85r0f2-1 for ; Thu, 21 Apr 2011 09:51:12 +0200 A-Original-Client-UID: 188.129.68.96 splivalo Received: from [192.168.10.1] (cpe-188-129-68-96.dynamic.amis.hr [188.129.68.96]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: splivalo) by smtp.amis.hr (Postfix) with ESMTPSA id 8E27B27C for ; Thu, 21 Apr 2011 09:51:12 +0200 (CEST) Message-ID: <4DAFE1F0.6030508@megafon.hr> Date: Thu, 21 Apr 2011 09:51:12 +0200 From: Mario Splivalo User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Re: Reseting statistics, cluster wide References: <4DAF3492.1000205@megafon.hr> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.2.15, 1.0.148, 0.0.0000 definitions=2011-04-20_09:2011-04-21, 2011-04-20, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=1 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1012030000 definitions=main-1104210003 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201104/199 X-Sequence-Number: 37380 On 04/20/2011 10:49 PM, raghu ram wrote: > On Thu, Apr 21, 2011 at 1:01 AM, Mario Splivalo > > wrote: > I have set up munin monitoring that plots nice graphs using > pg_stat_bgwriter and pg_stat_database views. It has been on for > quite some time now, and the numbers those views return are too big > for munin to handle. I would like to reset those statistics. As > explained by manual, pg_stat_reset() resets only db-related > statistics, not the ones used cluster-wide. Is there a way to reset > those? I don't mind stopping the server if I need to, but I'd realy > like to have those started all over again. > Currently we don't have such feature to reset statistics on cluster > level. You have to use two PostgreSQL functions like > pg_stat_reset_shared(text), pg_stat_reset (). > There are a few statistics that are only kept on a per-cluster basis, > such as those reported in pg_stat_database and pg_stat_bgwriter. Since > pg_stat_reset only resets per-database statistics. > > > psql=# select pg_stat_reset(); > > > psql=# select pg_stat_reset_shared('bgwritter'); -- It will reset the > statistics shown by pg_stat_bgwritter. > Heh, I've neglected to mention that i'm using postgres 8.4.5 on Debian Stable. Is there a way to reset statistics on pg8.4? I've tested it on 9.0 and it works there. Mario