Thread: Like search performance.

Like search performance.

From
"Diehl, Jeffrey"
Date:
Hi all,

I have a fairly large table with a char(20) field in it which I search on
quite a bit.  The problem is that I tend to do a lot of
"...where field like '%-d%'" type searches on this field.

Is there any to speed up this type of search?

TIA,

Mike Diehl.


Re: [PERFORM] Like search performance.

From
Josh Berkus
Date:
Mike,

> I have a fairly large table with a char(20) field in it which I search on
> quite a bit.  The problem is that I tend to do a lot of
> "...where field like '%-d%'" type searches on this field.
>
> Is there any to speed up this type of search?

Yes.  See the tsearch module in /contrib in your postgresql source.

--
-Josh Berkus
 Aglio Database Solutions
 San Francisco