pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Davis <pgsql@j-davis.com>
To: Amitabh Kant <amitabhkant@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Usage of pg_stat_database
Date: Thu, 27 Oct 2011 22:54:51 -0700
Message-ID: <1319781291.14128.5.camel@jdavis> (raw)
In-Reply-To: <CAPTAQBJOzWw+rY1gaq1Uppcx5k7O2BZ8PoiJAGyFHpDco_e4yg@mail.gmail.com>
References: <CAPTAQBJOzWw+rY1gaq1Uppcx5k7O2BZ8PoiJAGyFHpDco_e4yg@mail.gmail.com>

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





view thread (3+ messages)  latest in thread

Message-ID: <1319781291.14128.5.camel@jdavis>
Permalink:  ../1319781291.14128.5.camel@jdavis/
Also on:    postgresql.org/message-id/1319781291.14128.5.camel@jdavis

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: pgsql@j-davis.com, amitabhkant@gmail.com
  Subject: Re: Usage of pg_stat_database
  In-Reply-To: <1319781291.14128.5.camel@jdavis>

* 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