PostgreSQL 效能

一些效能調校會用到的SQL

SELECT   
sum(idx_blks_read) as idx_read, sum(idx_blks_hit) as idx_hit,
(sum(idx_blks_hit) - sum(idx_blks_read)) / sum(idx_blks_hit) as ratio
FROM pg_statio_user_indexes;