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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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 ?


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux