pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chris <dmagick@gmail.com>
To: Nico <Nicolas.PAYART@gmail.com>
Subject: Re: Optimizing performance of a like '%...%' condition
Date: Tue, 14 Feb 2006 13:32:32 +1100
Message-ID: <43F14140.8050005@gmail.com> (raw)
In-Reply-To: <1139586432.014319.114830@g47g2000cwa.googlegroups.com>
References: <1139586432.014319.114830@g47g2000cwa.googlegroups.com>


> Indexing the t_name.name field, I can increase speed, but only if I
> restrict my search to something like :
> 
> select *
> from t_name
> where t_name.name like 'my_search%'
> 
> (In this case it takes generally less than 1 second)
> 
> 
> My question : Are there algorithms or tools that can speed up such a
> type of queries ("like" condition begining with a "%" symbol) ?

Apart from indexing the field you could use full text indexing. See 
http://techdocs.postgresql.org/techdocs/fulltextindexing.php


What other types of queries are you running that you want to speed up ?



Message-ID: <43F14140.8050005@gmail.com>
Permalink:  ../43F14140.8050005@gmail.com/
Also on:    postgresql.org/message-id/43F14140.8050005@gmail.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: dmagick@gmail.com, Nicolas.PAYART@gmail.com
  Subject: Re: Optimizing performance of a like '%...%' condition
  In-Reply-To: <43F14140.8050005@gmail.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