Accounting of zero-filled buffers in EXPLAIN (BUFFERS)

Поиск
Список
Период
Сортировка
От Thomas Munro
Тема Accounting of zero-filled buffers in EXPLAIN (BUFFERS)
Дата
Msg-id CAEepm=3JytB3KPpvSwXzkY+dwc5zC8P8Lk7Nedkoci81_0E9rA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Accounting of zero-filled buffers in EXPLAIN (BUFFERS)  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Hi,

In EXPLAIN (BUFFERS), there are two kinds of cache misses that show up
as "reads" when in fact they are not reads at all:

1.  Relation extension, which in fact writes a zero-filled block.
2.  The RBM_ZERO_* modes, which provoke neither read nor write.

Here's a suggested fix.

I noticed this because I have some patches in development that hit
these cases a bit more and the numbers didn't match my expectation.  I
suppose someone might want a separate counter for zero-filled buffers
(they're still buffer interactions and cache misses) but it seems like
it's probably below the kind of thing we're interested in counting
(though in passing, I notice recently that some kernels keep some free
pages pre-zeroed so they can supply them faster, which is curious).

-- 
Thomas Munro
http://www.enterprisedb.com

Вложения

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: Postgres, fsync, and OSs (specifically linux)
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Accounting of zero-filled buffers in EXPLAIN (BUFFERS)