Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id B64DA6351C2 for ; Fri, 20 Mar 2009 14:34:06 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 34862-02 for ; Fri, 20 Mar 2009 14:34:00 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from westnet.com (westnet.com [216.187.52.2]) by mail.postgresql.org (Postfix) with ESMTP id 5368B6351AA for ; Fri, 20 Mar 2009 14:34:02 -0300 (ADT) Received: from westnet.com (localhost [127.0.0.1]) by westnet.com (8.14.0/8.14.0) with ESMTP id n2KHY0Kd005982; Fri, 20 Mar 2009 13:34:00 -0400 (EDT) Received: from localhost (gsmith@localhost) by westnet.com (8.14.0/8.13.2/Submit) with ESMTP id n2KHY0w0005975; Fri, 20 Mar 2009 13:34:00 -0400 (EDT) X-Authentication-Warning: westnet.com: gsmith owned process doing -bs Date: Fri, 20 Mar 2009 13:34:00 -0400 (EDT) From: Greg Smith X-X-Sender: gsmith@westnet.com To: "ml@bortal.de" cc: pgsql-performance@postgresql.org Subject: Re: current transaction in productive database In-Reply-To: <49C36145.1080909@bortal.de> Message-ID: References: <49C36145.1080909@bortal.de> User-Agent: Alpine 2.01 (GSO 1184 2008-12-16) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=AWL=0.000 X-Spam-Level: X-Archive-Number: 200903/294 X-Sequence-Number: 33216 On Fri, 20 Mar 2009, ml@bortal.de wrote: > is there a way to find out, how many transactions my currenc productive > database is doing? What you probably want here is not a true transaction count, which might include thing that don't matter much for scaling purposes, but instead to count things happening that involve a database change. You can find out totals for that broken down by table using this: select * from pg_stat_user_tables See http://www.postgresql.org/docs/8.3/static/monitoring-stats.html for more details. You'll want to sum the totals for inserts, updates, and deletes to get all the normal transcations. That will be a total since the statistics were last reset. If you want a snapshot for a period, you can either sample at the beginning and end and subtract, or you can use: select pg_stat_reset(); To reset everything, wait for some period, and then look at the totals. You may not want to do that immediately though. The totals since the database were brought up that you'll find in the statistics views can be interesting to look at for some historical perspective, so you should probably save any of those that look interesting before you reset anything. -- * Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD