Home > Archive > PostgreSQL Patches > May 2005 > Re: updated GiST patch









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: updated GiST patch
Tom Lane

2005-05-16, 1:23 pm

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

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Neil Conway

2005-05-17, 3:24 am

Patch applied.

Tom Lane wrote:
> Neil Conway <neilc@samurai.com> writes:
>
>
>
>
> I'd leave it as-is; ISTM to be more easily understandable than the
> alternatives you suggest.


Yeah, fair enough.

-Neil

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com