pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mario Weilguni <mweilguni@sime.com>
To: Fernan Aguero <fernan@unsam.edu.ar>
Cc: PostgreSQL Performance <pgsql-performance@postgresql.org>
Subject: Re: efficient pattern queries (using LIKE, ~)
Date: Tue, 11 Sep 2007 21:08:37 +0200
Message-ID: <46E6E7B5.8000807@sime.com> (raw)
In-Reply-To: <20070911185442.GA38153@iib.unsam.edu.ar>
References: <20070911185442.GA38153@iib.unsam.edu.ar>

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.




view thread (2+ messages)

Message-ID: <46E6E7B5.8000807@sime.com>
Permalink:  ../46E6E7B5.8000807@sime.com/
Also on:    postgresql.org/message-id/46E6E7B5.8000807@sime.com

 · 

reply

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-performance@postgresql.org
  Cc: mweilguni@sime.com, fernan@unsam.edu.ar
  Subject: Re: efficient pattern queries (using LIKE, ~)
  In-Reply-To: <46E6E7B5.8000807@sime.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