Re: [PERFORM] Help with LIKE - Mailing list pgsql-sql

From Josh Berkus
Subject Re: [PERFORM] Help with LIKE
Date
Msg-id 200303201355.32718.josh@agliodbs.com
Whole thread Raw
In response to Help with LIKE  ("David Olbersen" <DOlbersen@stbernard.com>)
List pgsql-sql
David,

> I have a table with 8,628,633 rows that I'd LIKE to search (ha ha).
>
> I have a very simple query:
>   SELECT * FROM tableA WHERE column1 LIKE '%something%';

That's what's called an "unanchored text search".   That kind of query cannot
be indexed using a regular index.

What you need is called "Full Text Indexing" or "Full Text Search".   Check
out two resources:

1) contrib/tsearch in your PostgreSQL source code;
2) OpenFTS (www.openfts.org).

--
-Josh Berkus
 Aglio Database Solutions
 San Francisco


pgsql-sql by date:

Previous
From: "David Olbersen"
Date:
Subject: Help with LIKE
Next
From: "David Olbersen"
Date:
Subject: Re: [PERFORM] Help with LIKE