From: Josh Berkus <josh@agliodbs.com>
To: David Olbersen <DOlbersen@stbernard.com>
To: pgsql-sql@postgresql.org
Cc: pgsql-performance@postgresql.org
Subject: Re: Help with LIKE
Date: Thu, 20 Mar 2003 13:55:32 -0800
Message-ID: <200303201355.32718.josh@agliodbs.com> (raw)
In-Reply-To: <E7E213858379814A9AE48CA6754F5ECB0D6C2D@mail01.stbernard.com>
References: <E7E213858379814A9AE48CA6754F5ECB0D6C2D@mail01.stbernard.com>
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
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: josh@agliodbs.com, DOlbersen@stbernard.com, pgsql-performance@postgresql.org
Subject: Re: Help with LIKE
In-Reply-To: <200303201355.32718.josh@agliodbs.com>
* 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