Re: ILIKE and indexes

From: "Guillaume Smet" <guillaume(dot)smet(at)gmail(dot)com>
To: "Martijn van Oosterhout" <kleptog(at)svana(dot)org>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ILIKE and indexes
Date: 2007-03-18 19:51:36
Message-ID: 1d4e0c10703181251n2af1714fo7e1a155c84fd65e3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 3/18/07, Martijn van Oosterhout <kleptog(at)svana(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Islam Hegazy 2007-03-18 19:54:55 modifying the tbale function
Previous Message Islam Hegazy 2007-03-18 19:48:45 modifying the table function