Re: index on user defined type - Mailing list pgsql-general

From Jeff Davis
Subject Re: index on user defined type
Date
Msg-id 1105582355.2886.396.camel@jeff
Whole thread Raw
In response to Re: index on user defined type  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: index on user defined type
List pgsql-general
On Wed, 2005-01-12 at 18:12 -0500, Tom Lane wrote:
> Stephan Szabo <sszabo@megazone.bigpanda.com> writes:
> > I'm wondering if the function under = is an SQL function being inlined.
>
> Bingo --- that's surely it.  After inlining, the expression would no
> longer look like it matched the index.
>
> You don't want to use SQL functions to define indexable operators
> anyway.  They leak memory, and are slow, and neither of those are
> good properties for an index support function.
>
>             regards, tom lane

Thanks very much guys. I got confused and tried to simplify it to a
simple test case and confused myself more when it still didn't work.
Just to be sure I redid it in plpgsql with no problems.

I understand that index operations should be written in C for production
use, or at least tested in C to see if it helps matters. Comparison
operators are of course very simple to write in any language anyway.

I attached a proposed documentation patch. I wasn't able to readily see
the implications of writing a function in SQL regarding an index, so
perhaps this will help someone in the future (not that many people will
attempt writing index access methods in SQL, but someone could get
confused like I did).

Regards,
    Jeff Davis


Attachment

pgsql-general by date:

Previous
From: Josué Maldonado
Date:
Subject: Re: Postgresql Text field / Visual FoxPro Memo and ODBC
Next
From: Paul Tillotson
Date:
Subject: Re: Postgresql Text field / Visual FoxPro Memo and ODBC