Table of Contents
pg_stat_activity
pg_stat_replication
pg_stat_replication_slots
pg_stat_wal_receiver
pg_stat_recovery_prefetch
pg_stat_subscription
pg_stat_subscription_stats
pg_stat_ssl
pg_stat_gssapi
pg_stat_archiver
pg_stat_bgwriter
pg_stat_wal
pg_stat_database
pg_stat_database_conflicts
pg_stat_all_tables
pg_stat_all_indexes
pg_statio_all_tables
pg_statio_all_indexes
pg_statio_all_sequences
pg_stat_user_functions
pg_stat_slru
A database administrator frequently wonders, “What is the system doing right now?” This chapter discusses how to find that out.
Several tools are available for monitoring database activity and
analyzing performance. Most of this chapter is devoted to describing
PostgreSQL's cumulative statistics system,
but one should not neglect regular Unix monitoring programs such as
ps
, top
, iostat
, and vmstat
.
Also, once one has identified a
poorly-performing query, further investigation might be needed using
PostgreSQL's EXPLAIN
command.
Section 14.1 discusses EXPLAIN
and other methods for understanding the behavior of an individual
query.