1 # Pre-defined queries of collectd's postgresql plugin.
3 # Do not edit this file. If you want to change any of the query definitions,
4 # overwrite them in collectd.conf instead.
6 # This file is distributed under the same terms as collectd itself.
9 Statement "SELECT count(*) AS count \
10 FROM pg_stat_activity \
22 Statement "SELECT xact_commit, xact_rollback \
23 FROM pg_stat_database \
30 InstancePrefix "commit"
31 ValuesFrom "xact_commit"
35 InstancePrefix "rollback"
36 ValuesFrom "xact_rollback"
41 Statement "SELECT sum(n_tup_ins) AS ins, \
42 sum(n_tup_upd) AS upd, \
43 sum(n_tup_del) AS del \
44 FROM pg_stat_user_tables;"
66 Statement "SELECT sum(n_tup_ins) AS ins, \
67 sum(n_tup_upd) AS upd, \
68 sum(n_tup_del) AS del, \
69 sum(n_tup_hot_upd) AS hot_upd \
70 FROM pg_stat_user_tables;"
89 InstancePrefix "hot_upd"
97 Statement "SELECT sum(seq_scan) AS seq, \
98 sum(seq_tup_read) AS seq_tup_read, \
99 sum(idx_scan) AS idx, \
100 sum(idx_tup_fetch) AS idx_tup_fetch \
101 FROM pg_stat_user_tables;"
110 InstancePrefix "seq_tup_read"
111 ValuesFrom "seq_tup_read"
120 InstancePrefix "idx_tup_fetch"
121 ValuesFrom "idx_tup_fetch"
126 Statement "SELECT sum(n_live_tup) AS live, sum(n_dead_tup) AS dead \
127 FROM pg_stat_user_tables;"
131 InstancePrefix "live"
136 InstancePrefix "dead"
144 Statement "SELECT coalesce(sum(heap_blks_read), 0) AS heap_read, \
145 coalesce(sum(heap_blks_hit), 0) AS heap_hit, \
146 coalesce(sum(idx_blks_read), 0) AS idx_read, \
147 coalesce(sum(idx_blks_hit), 0) AS idx_hit, \
148 coalesce(sum(toast_blks_read), 0) AS toast_read, \
149 coalesce(sum(toast_blks_hit), 0) AS toast_hit, \
150 coalesce(sum(tidx_blks_read), 0) AS tidx_read, \
151 coalesce(sum(tidx_blks_hit), 0) AS tidx_hit \
152 FROM pg_statio_user_tables;"
156 InstancePrefix "heap_read"
157 ValuesFrom "heap_read"
161 InstancePrefix "heap_hit"
162 ValuesFrom "heap_hit"
166 InstancePrefix "idx_read"
167 ValuesFrom "idx_read"
171 InstancePrefix "idx_hit"
176 InstancePrefix "toast_read"
177 ValuesFrom "toast_read"
181 InstancePrefix "toast_hit"
182 ValuesFrom "toast_hit"
186 InstancePrefix "tidx_read"
187 ValuesFrom "tidx_read"
191 InstancePrefix "tidx_hit"
192 ValuesFrom "tidx_hit"
197 Statement "SELECT pg_database_size($1) AS size;"
207 # vim: set ft=config :