Re: ILIKE and indexes - Mailing list pgsql-hackers

From Guillaume Smet
Subject Re: ILIKE and indexes
Date
Msg-id 1d4e0c10703181251n2af1714fo7e1a155c84fd65e3@mail.gmail.com
Whole thread Raw
In response to Re: ILIKE and indexes  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-hackers
On 3/18/07, Martijn van Oosterhout <kleptog@svana.org> wrote:
> Er, it's link between LIKE and the ~=~ that's hard coded

Yes.

> So I think it's easier that you think: just build the operator class
> and make sure you use the right operator so the planner uses it. ILIKE
> already maps to an operator...

Yeah I know. The fact is that you can't use an index for any pattern
and it depends on the database encoding too. The code in the planner
checks that the pattern and the database encoding makes the index
usable and rewrites the LIKE clause (and the ILIKE clause if the
pattern begins with a non alpha character) so that it can use the
index.
So I'm pretty sure I have to change this behaviour in the planner or
did I miss something?

--
Guillaume


pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: ILIKE and indexes
Next
From: "Islam Hegazy"
Date:
Subject: modifying the tbale function