Re: best practise/pattern for large OR / LIKE searches

Поиск
Список
Период
Сортировка
От Christophe Pettus
Тема Re: best practise/pattern for large OR / LIKE searches
Дата
Msg-id 27D60055-0159-4254-9107-A7F3E7141F9F@thebuild.com
обсуждение исходный текст
Ответ на best practise/pattern for large OR / LIKE searches  (Ries van Twisk <pg@rvt.dds.nl>)
Список pgsql-general
> SELECT * FROM tbl WHERE datanumber LIKE '%12345%' OR LIKE '%54321%'
> OR LIKE '%8766%' OR LIKE '%009%', ..
>
> The number of OR/LIKES are in the order of 50-100 items...
> the table tbl is a couple of million rows.

Are the fixed strings in the wildcards "words" (i.e., are they
completely arbitrarily embedded in the text, or are they delimited in
some regular way)? If they are "words," you might consider using the
full text functionality to create an index of them, and searching
using that.

--
-- Christophe Pettus
    xof@thebuild.com


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

Предыдущее
От: Vick Khera
Дата:
Сообщение: Re: How to simulate crashes of PostgreSQL?
Следующее
От: Erwin Brandstetter
Дата:
Сообщение: Import data from XML file