# Pre-defined queries of collectd's postgresql plugin.
Query "SELECT count(*) \
FROM pg_stat_activity \
WHERE datname = $1;"
Param database
Column pg_numbackends
Query "SELECT xact_commit, xact_rollback \
FROM pg_stat_database \
WHERE datname = $1;"
Param database
Column pg_xact commit
Column pg_xact rollback
Query "SELECT sum(n_tup_ins), sum(n_tup_upd), sum(n_tup_del) \
FROM pg_stat_user_tables;"
Column pg_n_tup_c ins
Column pg_n_tup_c upd
Column pg_n_tup_c del
MaxPGVersion 80299
Query "SELECT sum(n_tup_ins), sum(n_tup_upd), sum(n_tup_del), \
sum(n_tup_hot_upd) \
FROM pg_stat_user_tables;"
Column pg_n_tup_c ins
Column pg_n_tup_c upd
Column pg_n_tup_c del
Column pg_n_tup_c hot_upd
MinPGVersion 80300
Query "SELECT sum(seq_scan), sum(seq_tup_read), \
sum(idx_scan), sum(idx_tup_fetch) \
FROM pg_stat_user_tables;"
Column pg_scan seq
Column pg_scan seq_tup_read
Column pg_scan idx
Column pg_scan idx_tup_fetch
Query "SELECT sum(n_live_tup), sum(n_dead_tup) \
FROM pg_stat_user_tables;"
Column pg_n_tup_g live
Column pg_n_tup_g dead
MinPGVersion 80300
Query "SELECT sum(heap_blks_read), sum(heap_blks_hit), \
sum(idx_blks_read), sum(idx_blks_hit), \
sum(toast_blks_read), sum(toast_blks_hit), \
sum(tidx_blks_read), sum(tidx_blks_hit) \
FROM pg_statio_user_tables;"
Column pg_blks heap_read
Column pg_blks heap_hit
Column pg_blks idx_read
Column pg_blks idx_hit
Column pg_blks toast_read
Column pg_blks toast_hit
Column pg_blks tidx_read
Column pg_blks tidx_hit
Query "SELECT pg_database_size($1);"
Param database
Column pg_db_size