Re: Help with LIKE

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Help with LIKE
Дата
Msg-id 8915.1048212381@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Help with LIKE  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-performance
Josh Berkus <josh@agliodbs.com> writes:
>> SELECT * FROM table WHERE url ~ '^http://.*something.*$';

> That search still requires a seq scan, since it has "gaps" in the seqence of
> characters.  That is,

> url ~ '^http://www.something.*' could use an index, but your search above
> cannot.

Actually, it *can* use an index ... but the index condition will only
use the characters before the ".*", ie, "http://".  Which is just about
useless if you're searching a column of URLs :-(

I agree that tsearch or OpenFTS are the tools to be looking at.

            regards, tom lane

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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: Help with LIKE
Следующее
От: "Shridhar Daithankar"
Дата:
Сообщение: Re: Page Size in Future Releases