heap_blks_hit and heap_blks_read

Поиск
Список
Период
Сортировка
От Fernando Papa
Тема heap_blks_hit and heap_blks_read
Дата
Msg-id CB94A4924490EC4A81EDA55BA378B7BA3B69A3@exch2k01.buehuergo.corp.claxson.com
обсуждение исходный текст
Список pgsql-general
Hi all!

I'm trying to set up several scripts to get information about how
database is used. Actually I try to get "cache ratio" or "buffer ratio"
(like Oracle "buffer cache hit ratio").
With "sum(heap_blks_hit) from pg_statio_user_tables" I get buffer reads,
and with "sum(heap_blks_read) from pg_statio_user_tables" I get disk
read... It's that true?
But I'mt thinking about this: when postgres read from disk and then put
data into buffer... both heap_blks_hit and heap_blks_read are increased?
or only heap_blks_read are increased?
Is this formula correct?: "select
sum(heap_blks_hit)*100/(sum(heap_blks_hit)+sum(heap_blks_read)) from
pg_statiouser_tables"

I'm not counting system tables for now, but I think could be easy to
change "user_tables" with "all_tables", and add pg_statio_all_indx too.

Thanks in advance.

--
Fernando O. Papa

В списке pgsql-general по дате отправления:

Предыдущее
От: Andrew Sullivan
Дата:
Сообщение: Re: 2 questions
Следующее
От: Robert Treat
Дата:
Сообщение: Re: Hot Backup