Re: Optimizing performance of a like '%...%' condition

From: Chris <dmagick(at)gmail(dot)com>
To: Nico <Nicolas(dot)PAYART(at)gmail(dot)com>
Subject: Re: Optimizing performance of a like '%...%' condition
Date: 2006-02-14 02:32:32
Message-ID: 43F14140.8050005@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


> 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 ?

Browse pgsql-performance by date

  From Date Subject
Next Message Adnan DURSUN 2006-02-14 09:33:57 Re: SQL Function Performance
Previous Message Michael Fuhr 2006-02-14 01:31:54 Re: SQL Function Performance