Database statistics

One database's rows in pg_stat_database and pg_stat_database_conflicts, plus size, connection limit and XID ages from pg_database, formatted.

The database statistics tab

Opening the statistics

Alt+I on a database row of a connected server (not on rows inside it), or the context menu (F2). One tab per database, with its own session on that database; the values are those of current_database().

The values are read when you ask

No timer: one query when the tab opens and on each F5. The status row shows its statement_timestamp() (server clock). All counters are cumulative since stats_reset.

The summary boxes

BoxSource
Sizepg_database_size().
Backendsnumbackends and datconnlimit: 41 (no limit) or 41 / 100. The tab's own backend is counted.
Cache hit ratioblks_hit / (blks_hit + blks_read), since the statistics reset.
Transactionsxact_commit, xact_rollback.
XID ageage(datfrozenxid). The backend holding back the xmin horizon is named on the dashboard.

The list

GroupSource
Databasepg_database_size(), numbackends, datconnlimit, age(datfrozenxid), mxid_age(datminmxid), stats_reset.
Transactionsxact_commit, xact_rollback, deadlocks.
Block I/Oblks_read, blks_hit, the hit ratio, blk_read_time, blk_write_time (0 unless track_io_timing = on).
Tuplestup_returned, tup_fetched, tup_inserted, tup_updated, tup_deleted.
Temporary filestemp_files, temp_bytes.
Sessions (14+)sessions, sessions_abandoned, sessions_fatal, sessions_killed, session_time, active_time, idle_in_transaction_time.
Checksums (12+)checksum_failures, checksum_last_failure; checksums off without data checksums.
Parallel workers (18+)parallel_workers_to_launch, parallel_workers_launched.
Recovery conflictsconflicts and the confl_* columns of pg_stat_database_conflicts (logical slot: 16+).

Groups the server version does not have are left out.

How values are written

Counts with thousands separators; sizes readable plus exact bytes (1250 MB (1,310,368,640 bytes)); times in the fitting unit; ratios in percent; NULL as [null].

Keys

Key
F5Read again; reconnect after a lost session.
Ctrl+CCopy the cell; after Ctrl+A, the whole list, tab-separated.
F2Context menu.

Where to look for more

Current activity: the server dashboard. Statement trace: the SQL profiler. Per-relation statistics (pg_stat_user_tables) have no tab; query them in a query tab.