From: Euler Taveira de Oliveira <euler@timbira.com>
To: ml@bortal.de <ml@bortal.de>
Cc: pgsql-performance@postgresql.org
Subject: Re: current transaction in productive database
Date: Fri, 20 Mar 2009 14:50:36 -0300
Message-ID: <49C3D76C.9040400@timbira.com> (raw)
In-Reply-To: <49C36145.1080909@bortal.de>
References: <49C36145.1080909@bortal.de>
ml@bortal.de escreveu:
> is there a way to find out, how many transactions my currenc productive
> database is doing?
>
If you're looking for number of transactions then you can query the catalogs as:
$ export myq="select sum(xact_commit+xact_rollback) from pg_stat_database"
$ psql -U postgres -c "$myq" && sleep 60 && psql -U postgres -c "$myq"
sum
-----------
178992891
(1 row)
sum
-----------
178996065
(1 row)
$ bc -q
scale=3
(178996065-178992891)/60
52.900
Depending on your workload pattern, it's recommended to increase the sleep time.
--
Euler Taveira de Oliveira
http://www.timbira.com/
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: euler@timbira.com, ml@bortal.de
Subject: Re: current transaction in productive database
In-Reply-To: <49C3D76C.9040400@timbira.com>
* 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