Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id E25DEB5DC3B for ; Fri, 28 Oct 2011 02:54:50 -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 14214-01 for ; Fri, 28 Oct 2011 05:54:44 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mail-pz0-f44.google.com (mail-pz0-f44.google.com [209.85.210.44]) by mail.postgresql.org (Postfix) with ESMTP id 91B84B5DC35 for ; Fri, 28 Oct 2011 02:54:44 -0300 (ADT) Received: by pzk4 with SMTP id 4so18348484pzk.3 for ; Thu, 27 Oct 2011 22:54:43 -0700 (PDT) Received: by 10.68.209.103 with SMTP id ml7mr2770064pbc.17.1319781283719; Thu, 27 Oct 2011 22:54:43 -0700 (PDT) Received: from [192.168.1.102] (c-69-181-249-16.hsd1.ca.comcast.net. [69.181.249.16]) by mx.google.com with ESMTPS id le18sm20941327pbb.3.2011.10.27.22.54.39 (version=SSLv3 cipher=OTHER); Thu, 27 Oct 2011 22:54:40 -0700 (PDT) Message-ID: <1319781291.14128.5.camel@jdavis> Subject: Re: Usage of pg_stat_database From: Jeff Davis To: Amitabh Kant Cc: pgsql-performance@postgresql.org Date: Thu, 27 Oct 2011 22:54:51 -0700 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.0- Content-Transfer-Encoding: 7bit Mime-Version: 1.0 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: 201110/244 X-Sequence-Number: 45466 On Mon, 2011-10-24 at 19:34 +0530, Amitabh Kant wrote: > If I read the xact_commit field returned by "Select * from > pg_stat_database" multiple times, and then average the difference > between consecutive values, would this give an approx idea about the > transactions per second in my database? Yes, approximately. It relies on the stats messages. > Does this figure include the number of select statements being > executed in the db? > Yes, a quick test shows that select statements count as well. However, it seems that very simple selects, like "SELECT 1" might not send the stats messages right away, and they might end up getting lost. Regards, Jeff Davis