From: Nikolaus Dilger <nikolaus@dilger.cc>
To: jdiehl@sandia.gov
Cc: pgsql-sql@postgresql.org
Cc: pgsql-performance@postgresql.org
Subject: Re: Like search performance.
Date: Wed, 30 Apr 2003 10:08:28 -0700 (PDT)
Message-ID: <20030430100829.9198.h014.c001.wm@mail.dilger.cc.criticalpath.net> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: nikolaus@dilger.cc, jdiehl@sandia.gov, pgsql-performance@postgresql.org
Subject: Re: Like search performance.
In-Reply-To: <20030430100829.9198.h014.c001.wm@mail.dilger.cc.criticalpath.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox