Re: Usage of pg_stat_database

From: Amitabh Kant <amitabhkant(at)gmail(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Usage of pg_stat_database
Date: 2011-10-28 06:37:44
Message-ID: CAPTAQBK8KBu0H8myd3aJstLTSX11n-g1yXos5uZS07N7bJCN1g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Thanks Jeff. This should help in getting a fairly approximate values.

Amitabh

On Fri, Oct 28, 2011 at 11:24 AM, Jeff Davis <pgsql(at)j-davis(dot)com> wrote:

> 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
>
>
>

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Amitabh Kant 2011-10-28 06:40:10 Re: Choosing between Intel 320, Intel 510 or OCZ Vertex 3 SSD for db server
Previous Message Jeff Davis 2011-10-28 05:54:51 Re: Usage of pg_stat_database