Re: efficient pattern queries (using LIKE, ~) - Mailing list pgsql-performance

From Mario Weilguni
Subject Re: efficient pattern queries (using LIKE, ~)
Date
Msg-id 46E6E7B5.8000807@sime.com
Whole thread Raw
In response to efficient pattern queries (using LIKE, ~)  (Fernan Aguero <fernan@unsam.edu.ar>)
List 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.


pgsql-performance by date:

Previous
From: Fernan Aguero
Date:
Subject: efficient pattern queries (using LIKE, ~)
Next
From: Jean-David Beyer
Date:
Subject: Re: random_page_costs - are defaults of 4.0 realistic for SCSI RAID 1