Re: efficient pattern queries (using LIKE, ~)

From: Mario Weilguni <mweilguni(at)sime(dot)com>
To: Fernan Aguero <fernan(at)unsam(dot)edu(dot)ar>
Cc: PostgreSQL Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: efficient pattern queries (using LIKE, ~)
Date: 2007-09-11 19:08:37
Message-ID: 46E6E7B5.8000807@sime.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Fernan Aguero schrieb:
> Hi,
>
> I have a table containing some ~13 million rows. Queries on
> indexed fields run fast, but unanchored pattern queries on a
> text column are slooooow. Indexing the column doesn't help
> (this is already mentioned in the manual).
> http://www.postgresql.org/docs/8.2/interactive/indexes-types.html
>
> However, no alternative solution is mentioned for indexing
> and/or optimizing queries based on unanchored patterns:
> i.e. description LIKE '%kinase%'.

Maybe trigram search might help you? Never tried it myself, but it seems
to be able to handle substring searches.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Guy Rouillier 2007-09-11 19:52:40 Re: Barcelona vs Tigerton
Previous Message Fernan Aguero 2007-09-11 18:54:42 efficient pattern queries (using LIKE, ~)