Re: LIKE should use index when condition doesn't include - Mailing list pgsql-performance

From Tom Lane
Subject Re: LIKE should use index when condition doesn't include
Date
Msg-id 29185.1080711231@sss.pgh.pa.us
Whole thread Raw
In response to Re: LIKE should use index when condition doesn't include  (Josh Berkus <josh@agliodbs.com>)
List pgsql-performance
Josh Berkus <josh@agliodbs.com> writes:
> ILIKE is not somehow aware that it is equivalent to lower().

Is it?  Given the wild and wonderful behaviors of locales here and
there, I wouldn't want to assume that such an equivalence holds.

In particular I note that iclike() seems to be multibyte-aware while
lower() definitely is not.  Even if that's just a bug, it's a big leap
to assume that ILIKE is equivalent to LIKE on lower().  Think about
Turkish i/I, German esstet (did I spell that right?), ch in various
languages, etc etc.

            regards, tom lane

pgsql-performance by date:

Previous
From: Josh Berkus
Date:
Subject: Re: LIKE should use index when condition doesn't include
Next
From: Richard Huxton
Date:
Subject: Re: select slow?