Re: updated GiST patch

From: Neil Conway <neilc(at)samurai(dot)com>
To: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: updated GiST patch
Date: 2005-05-16 14:19:16
Message-ID: 4288ABE4.1070900@samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
new_gist_patch-4.patch.gz application/x-tgz 17.2 KB

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Mahmoud Taghizadeh 2005-05-16 14:56:38 farsi faq has not been added yet in website,
Previous Message a_ogawa 2005-05-16 12:58:35 Re: AllocSetReset improvement