Re: Usage of pg_stat_database - Mailing list pgsql-performance

From Jeff Davis
Subject Re: Usage of pg_stat_database
Date
Msg-id 1319781291.14128.5.camel@jdavis
Whole thread Raw
In response to Usage of pg_stat_database  (Amitabh Kant <amitabhkant@gmail.com>)
Responses Re: Usage of pg_stat_database
List pgsql-performance
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



pgsql-performance by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: function slower than the same code in an sql file
Next
From: Amitabh Kant
Date:
Subject: Re: Usage of pg_stat_database