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

From Tom Lane
Subject Re: LIKE should use index when condition doesn't include wildcard
Date
Msg-id 26840.1080692204@sss.pgh.pa.us
Whole thread Raw
In response to LIKE should use index when condition doesn't include wildcard  (Palle Girgensohn <girgen@pingpong.net>)
Responses Re: LIKE should use index when condition doesn't include
List pgsql-performance
Palle Girgensohn <girgen@pingpong.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

pgsql-performance by date:

Previous
From: Palle Girgensohn
Date:
Subject: LIKE should use index when condition doesn't include wildcard
Next
From: Palle Girgensohn
Date:
Subject: Re: LIKE should use index when condition doesn't include