LIKE search and performance

Поиск
Список
Период
Сортировка
От Andy
Тема LIKE search and performance
Дата
Msg-id 009501c79d4c$445428f0$0b00a8c0@mpsro.dom
обсуждение исходный текст
Ответы Re: LIKE search and performance  (Richard Huxton <dev@archonet.com>)
Re: LIKE search and performance  (Guido Neitzer <lists@event-s.net>)
Re: LIKE search and performance  ("Alexander Staubo" <alex@purefiction.net>)
Re: LIKE search and performance  (Rigmor Ukuhe <rigmor.ukuhe@finestmedia.ee>)
Список pgsql-performance
Hi,
 
I have a table with varchar and text columns, and I have to search through these text in the whole table.
 
An example would be:
SELECT * FROM table
                             WHERE name like '%john%' or street like '%srt%'
 
Anyway, the query planner always does seq scan on the whole table and that takes some time. How can this be optimized or made in another way to be faster?
 
I tried to make indexes on the columns but no success.
 
PG 8.2
 
Regards,
Andy.

В списке pgsql-performance по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: does VACUUM ANALYZE complete with this error?
Следующее
От: Vivek Khera
Дата:
Сообщение: Re: performance drop on 8.2.4, reverting to 8.1.4