Re: updated GiST patch

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: updated GiST patch
Date: 2005-05-16 18:12:19
Message-ID: 19798.1116267139@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Neil Conway <neilc(at)samurai(dot)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

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2005-05-16 19:24:27 Re: Exec statement logging
Previous Message Mahmoud Taghizadeh 2005-05-16 14:56:38 farsi faq has not been added yet in website,