Re: Stats collector's idx_blks_hit value is highly misleading in practice

Поиск
Список
Период
Сортировка
От Sergey Dudoladov
Тема Re: Stats collector's idx_blks_hit value is highly misleading in practice
Дата
Msg-id CAA8Fd-rOJCR5-c8HqH758dcfDwXPiAUKSJa-N-Bujes9Hz5zuQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Stats collector's idx_blks_hit value is highly misleading in practice  (John Naylor <john.naylor@enterprisedb.com>)
Ответы Re: Stats collector's idx_blks_hit value is highly misleading in practice  (Sergey Dudoladov <sergey.dudoladov@gmail.com>)
Список pgsql-hackers
Hello,

I would like to get some feedback on that task.

> pg_statio_*_tables.idx_blks_hit are highly misleading in practice
> because they fail to take account of the difference between internal
> pages and leaf pages in B-Tree indexes.

I see it is still the case, so the issue is relevant, isn't it ?

> The main challenge would be
> passing information about what page we're dealing with (internal/leaf)
> to the place actually calling pgstat_count_buffer_(read|hit). That
> happens in ReadBufferExtended, which just has no idea what page it's
> dealing with. Not sure how to do that cleanly ...

I do not immediately see the way to pass the information in a
completely clean manner.

Either
(1) ReadBufferExtended needs to know the type of an index page (leaf/internal)
or
(2) caller of ReadBufferExtended that can check the page type needs to learn
if there was a hit and call pgstat_count_buffer_(read|hit) accordingly.

In either case necessary code changes seem quite invasive to me.
I have attached a code snippet to illustrate the second idea.

Regards,
Sergey

Вложения

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

Предыдущее
От: Daniel Gustafsson
Дата:
Сообщение: Re: TAP output format in pg_regress
Следующее
От: David Rowley
Дата:
Сообщение: Re: Can we do something to help stop users mistakenly using force_parallel_mode?