Re: updated GiST patch - Mailing list pgsql-patches

From Neil Conway
Subject Re: updated GiST patch
Date
Msg-id 4288ABE4.1070900@samurai.com
Whole thread Raw
In response to updated GiST patch  (Neil Conway <neilc@samurai.com>)
Responses Re: updated GiST patch
List pgsql-patches
Neil Conway wrote:
> This is an updated version of the GiST patch I posted a few months ago.

Attached is a revised version. This update fixes some newly-added bugs
in mark and restore (I forgot to save and restore the current buffer),
and 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...)

BTW, this idiom occurs a few times:

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

it would be nice to make this more concise. Perhaps:

     InvalidateBuffer(&buf);

although that doesn't make the modification of `buf' obvious. An
alternative would be to have ReleaseBuffer() always return
InvalidBuffer, so:

     if (BufferIsValid(buf))
         buf = ReleaseBuffer(buf);

Any thoughts on this? (I'm inclined to prefer InvalidateBuffer().)

-Neil

Attachment

pgsql-patches by date:

Previous
From: a_ogawa
Date:
Subject: Re: AllocSetReset improvement
Next
From: Tom Lane
Date:
Subject: Re: updated GiST patch