Re: "between" is using index but "like" is not

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: "between" is using index but "like" is not
Дата
Msg-id 200408251038.37508.josh@agliodbs.com
обсуждение исходный текст
Ответ на "between" is using index but "like" is not  (Jesper Krogh <jesper@krogh.cc>)
Ответы Re: "between" is using index but "like" is not  (Gaetano Mendola <mendola@bigfoot.com>)
Список pgsql-novice
Jesper,

> Why doesn't it use an index on the "like" operator when it doesn't contain
> a wildcard in the beginning of the pattern?

How many rows are there in the table?   What happens if you force an index
scan on the 2nd query?  Is this ASCII text or UNICODE text?

Normally LIKE 'xxx%' does use an index if it's useful, so there is something
else going on here.

--
Josh Berkus
Aglio Database Solutions
San Francisco

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

Предыдущее
От: Jesper Krogh
Дата:
Сообщение: "between" is using index but "like" is not
Следующее
От: Tom Lane
Дата:
Сообщение: Re: "between" is using index but "like" is not