Re: [PATCH] xlogreader: do not read a file block twice

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: [PATCH] xlogreader: do not read a file block twice
Дата
Msg-id 20190214065156.GE2366@paquier.xyz
обсуждение исходный текст
Ответ на Re: [PATCH] xlogreader: do not read a file block twice  (Arthur Zakirov <a.zakirov@postgrespro.ru>)
Ответы Re: [PATCH] xlogreader: do not read a file block twice  (Arthur Zakirov <a.zakirov@postgrespro.ru>)
Список pgsql-hackers
On Tue, Feb 12, 2019 at 11:44:14AM +0300, Arthur Zakirov wrote:
> Of course. Agree, it may be a non trivial case. Added as a bug fix:
> https://commitfest.postgresql.org/22/1994/

I have been looking at the patch, and I agree that the current coding
is a bit crazy.  If the wanted data has already been read, it makes
little sense to require reading it again if the size requested by the
caller of ReadPageInternal() exactly equals what has been read
already, and that's what the code is doing.

Now I don't actually agree that this qualifies as a bug fix.  As
things stand, a page may finish by being more than once if what has
been read previously equals what is requested, however this does not
prevent the code to work correctly.  The performance gain is also
heavily dependent on the callback reading a page and the way the WAL
reader is used.  How do you actually read WAL pages in your own
plugin with compressed data?  It begins by reading a full page once,
then it moves on to a per-record read after making sure that the page
has been read?
--
Michael

Вложения

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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: Making all nbtree entries unique by having heap TIDs participatein comparisons
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Incorrect visibility test function assigned to snapshot