Re: current transaction in productive database

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ml@xxxxxxxxx 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/

-- 
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux