Table of Contents
pg_stat_activitypg_stat_replicationpg_stat_replication_slotspg_stat_wal_receiverpg_stat_recovery_prefetchpg_stat_subscriptionpg_stat_subscription_statspg_stat_sslpg_stat_gssapipg_stat_archiverpg_stat_iopg_stat_bgwriterpg_stat_checkpointerpg_stat_walpg_stat_databasepg_stat_database_conflictspg_stat_all_tablespg_stat_all_indexespg_statio_all_tablespg_statio_all_indexespg_statio_all_sequencespg_stat_user_functionspg_stat_slruA 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 describingPostgreSQL's cumulative statistics system, but one should not neglect regular Unix monitoring programs such asps,top,iostat, andvmstat. Also, once one has identified a poorly-performing query, further investigation might be needed usingPostgreSQL'sEXPLAIN command.Section 14.1 discussesEXPLAIN and other methods for understanding the behavior of an individual query.