Re: LIKE and INDEX

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: LIKE and INDEX
Дата
Msg-id 40992E96.5090301@archonet.com
обсуждение исходный текст
Ответ на LIKE and INDEX  ("Jie Liang" <jie@stbernard.com>)
Список pgsql-performance
Jie Liang wrote:
> All,
> This is old topic, when I use:
> select url from urlinfo where url like 'http://www.lycos.de%';
> it uses the index, good!
>
> but if I use:
> select url from urlinfo where url like 'http://%.lycos.de';
> it won't use index at all, NOT good!
> is there any way I can force secon query use index???

I've seen people define a reverse(text) function via plperl or similar
then build a functional index on reverse(url). Of course, that would
rely on your knowing which end of your search pattern has the % wildcard.

--
   Richard Huxton
   Archonet Ltd

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

Предыдущее
От: Paul Tuckfield
Дата:
Сообщение: Re: very high CPU usage in "top", but not in "mpstat"
Следующее
От: Rod Taylor
Дата:
Сообщение: Re: LIKE and INDEX