Re: LIKE should use index when condition doesn't include

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: josh(at)agliodbs(dot)com
Cc: Palle Girgensohn <girgen(at)pingpong(dot)net>, pgsql-performance(at)postgresql(dot)org
Subject: Re: LIKE should use index when condition doesn't include
Date: 2004-03-31 05:33:51
Message-ID: 29185.1080711231@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Josh Berkus <josh(at)agliodbs(dot)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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Richard Huxton 2004-03-31 08:33:24 Re: select slow?
Previous Message Josh Berkus 2004-03-31 01:06:54 Re: LIKE should use index when condition doesn't include