Re: What index for 'like (%keyword%)' ??? - Mailing list pgsql-performance

From Christopher Kings-Lynne
Subject Re: What index for 'like (%keyword%)' ???
Date
Msg-id 406B6E0B.9050200@familyhealth.com.au
Whole thread Raw
In response to What index for 'like (%keyword%)' ???  ("Priem, Alexander" <ap@cict.nl>)
List pgsql-performance
> I am building a query which uses a clause like "Where doc_description like
> '%keyword%'". I know a normal index won't be of any use here, but since the
> table in question will get fairly big, I do want to use an index.
>
> Can anyone give me some advise on what kind of index I can use here? Or
> shouldn't I use one in this case?

You have to use a proper full text indexing scheme.  Investigate
contrib/tsearch2 module in the postgres distribution.

Chirs


pgsql-performance by date:

Previous
From: Gaetano Mendola
Date:
Subject: linux and anotime mount option
Next
From: "Gary Doades"
Date:
Subject: PostgreSQL and Linux 2.6 kernel.