Re: updated GiST patch

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: updated GiST patch
Дата
Msg-id 19798.1116267139@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: updated GiST patch  (Neil Conway <neilc@samurai.com>)
Ответы Re: updated GiST patch
Список pgsql-patches
Neil Conway <neilc@samurai.com> writes:
> ... replaces two ReleaseBuffer() + ReadBuffer() pairs with
> ReleaseAndReadBuffer(). (Is this still worth doing? It seems it no
> longer saves a lock acquire/release, but perhaps it will again be a win
> in some future version of the bufmgr...)

I think there is no longer any noticeable win except in the case where
the old and new pages are actually the same.  Which is probably unlikely
to be true inside an index AM (it is a useful win for random access into
a heap for instance).  But as you say it might someday again be useful.
My advice is to combine if and only if you're not contorting the code
to do so.

> BTW, this idiom occurs a few times:

>      if (BufferIsValid(buf))
>      {
>          ReleaseBuffer(buf);
>          buf = InvalidBuffer;
>      }

I'd leave it as-is; ISTM to be more easily understandable than the
alternatives you suggest.

            regards, tom lane

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

Предыдущее
От: Neil Conway
Дата:
Сообщение: Re: updated GiST patch
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Exec statement logging