I run the following query to estimate the ratio of index pages read rom memory (buffer hits) to index pages read from disk
select
t.schemaname,
t.relname as "Table Name",
io_i.indexrelname as "Index Name",
case when (io_i.idx_blks_hit <> 0 or io_i.idx_blks_read <> 0) then
round(io_i.idx_blks_hit/(io_i.idx_blks_hit::numeric +
io_i.idx_blks_read::numeric), 4) else null end as "Index Hit Ratio"
from
pg_stat_user_tables t
join pg_statio_user_indexes io_i on io_i.relid = t.relid
order by "Index Hit Ratio" desc;
And I have several indexes where this rate is too low (below 0.7). Please advise what could be the possible reason and how to improve it.