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

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

Palle Girgensohn <girgen(at)pingpong(dot)net> writes:
> Shouldn't the optimizer use indices if the like condition does not have any
> wildcards?

I can't get excited about this; if you are depending on LIKE to be fast
then you should have locale-insensitive indexes in place to support it.
Switching the tests around so that this special case is supported even
with an index that doesn't otherwise support LIKE would complicate the
code unduly IMHO, to support a rather pointless corner case...

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Palle Girgensohn 2004-03-31 00:28:31 Re: LIKE should use index when condition doesn't include
Previous Message Palle Girgensohn 2004-03-30 23:06:48 LIKE should use index when condition doesn't include wildcard