O'Reilly logo

PostgreSQL 9.0 High Performance by Gregory Smith

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Database wide totals

Many of the same pieces of data available at the table level are also summarized per database. You can get the following information out of pg_stat_database and use it in similar ways to pg_stat_user_tables and pg_statio_user_tables:

SELECT datname,blks_read,blks_hit,tup_returned,tup_fetched,tup_inserted ,tup_updated,tup_deleted FROM pg_stat_database;

In addition, there are some useful transaction commit statistics available, as well as a count of the total active client backend connections active for each database:

SELECT datname,numbackends,xact_commit,xact_rollback from pg_stat_database;

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required