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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: "between" is using index but "like" is not
Дата
Msg-id 2065.1093460399@sss.pgh.pa.us
обсуждение исходный текст
Ответ на "between" is using index but "like" is not  (Jesper Krogh <jesper@krogh.cc>)
Список pgsql-novice
Jesper Krogh <jesper@krogh.cc> writes:
> Why doesn't it use an index on the "like" operator when it doesn't
> contain a wildcard in the beginning of the pattern?

Probably because your locale isn't C --- locale-specific sort ordering
usually isn't compatible with the needs of LIKE, so we can only make
that optimization in C locale.

You can either re-initdb in C locale, or (if you're using 7.4) create a
specialized index with non-locale-dependent comparison operators.  See
the manual concerning specialized index operator classes.

            regards, tom lane

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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: "between" is using index but "like" is not
Следующее
От: Gaetano Mendola
Дата:
Сообщение: Re: "between" is using index but "like" is not