Re: Index to support LIKE '%suffix' queries

From: Florian Weimer <fw(at)deneb(dot)enyo(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Index to support LIKE '%suffix' queries
Date: 2006-02-25 17:52:43
Message-ID: 877j7jfhqs.fsf@mid.deneb.enyo.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

* Tom Lane:

> Florian Weimer <fw(at)deneb(dot)enyo(dot)de> writes:
>> Is it possible to create an index to support queries of the form
>> "column LIKE '%suffix'" (similar to an ordinary index for LIKE
>> 'prefix%', which I also need)?
>
> Sounds like what you *really* need is full-text search, not half
> measures ... have you looked at tsearch2?

Uh-oh, the table in question has got 50+ million rows (and is still
growing). Each "document" contains about three words. Do you think
tsearch2 could deal with that?

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Alvaro Herrera 2006-02-25 18:13:46 Re: Index to support LIKE '%suffix' queries
Previous Message Tom Lane 2006-02-25 17:22:27 Re: Index to support LIKE '%suffix' queries