Re: Like search performance. - Mailing list pgsql-performance

From Nikolaus Dilger
Subject Re: Like search performance.
Date
Msg-id 20030430100829.9198.h014.c001.wm@mail.dilger.cc.criticalpath.net
Whole thread Raw
In response to Like search performance.  ("Diehl, Jeffrey" <jdiehl@sandia.gov>)
List pgsql-performance
Jeffrey,

The best thing you can do is to have the wildcard % as
late as possible in your search condition.
So do like 'd%' instead of like '%d%' if you can.

Regards,
Nikolaus


On Wed, 30 Apr 2003 10:34:40 -0600, "Diehl, Jeffrey"
wrote:

>
> 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.
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster


pgsql-performance by date:

Previous
From: "Diehl, Jeffrey"
Date:
Subject: Like search performance.
Next
From: SZUCS Gábor
Date:
Subject: Re: Like search performance.