Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

PostgreSQL 8.4 has no blks_read & blks_hit, pushing 0.

  • Loading branch information...
commit 3f92cce0fb7124ecac94c6aab40fffd85518aaee 1 parent c6d39a4

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  postgres_gmetric.rb
2  postgres_gmetric.rb
@@ -42,7 +42,7 @@ def publish(sql)
42 42
 publish "select sum(seq_scan) as seq_scan, sum(seq_tup_read) as seq_tup_read, sum(idx_scan) as idx_scan, sum(idx_tup_fetch) as idx_tup_fetch, sum(n_tup_ins) as n_tup_ins, sum(n_tup_upd) as n_tup_upd, sum(n_tup_del) as n_tup_del, sum(n_tup_hot_upd) as n_tup_hot_upd, sum(n_live_tup) as n_live_tup, sum(n_dead_tup) as n_dead_tup from pg_stat_all_tables;"
43 43
 publish "select sum(heap_blks_read) as heap_blks_read, sum(heap_blks_hit) as heap_blks_hit, sum(idx_blks_read) as idx_blks_read_tbl, sum(idx_blks_hit) as idx_blks_hit_tbl, sum(toast_blks_read) as toast_blks_read, sum(toast_blks_hit) as toast_blks_hit, sum(tidx_blks_read) as tidx_blks_read, sum(tidx_blks_hit) as tidx_blks_hit from pg_statio_all_tables;"
44 44
 publish "select sum(idx_blks_read) as idx_blks_read, sum(idx_blks_hit) as idx_blks_hit from pg_statio_all_indexes;"
-publish "select sum(blks_read) as seq_blks_read, sum(blks_hit) as seq_blks_hit from pg_statio_all_sequences;"
+publish "select COALESCE(sum(blks_read), 0) as seq_blks_read, COALESCE(sum(blks_hit), 0) as seq_blks_hit from pg_statio_all_sequences;"
46 46
 # publish check_postgres bloat
47 47
 publish "SELECT sum(pg_database_size(d.oid)) as size_database FROM pg_database d ORDER BY 1 DESC LIMIT 10;"
48 48
 publish "SELECT sum(pg_relation_size(c.oid)) as size_table FROM pg_class c, pg_namespace n WHERE (relkind = 'r') AND n.oid = c.relnamespace;"

0 notes on commit 3f92cce

Please sign in to comment.
Something went wrong with that request. Please try again.