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

Поиск
Список
Период
Сортировка
От Jesper Krogh
Тема Re: "between" is using index but "like" is not
Дата
Msg-id cgk3c4$b8c$1@sea.gmane.org
обсуждение исходный текст
Ответ на "between" is using index but "like" is not  (Jesper Krogh <jesper@krogh.cc>)
Список pgsql-novice
I gmane.comp.db.postgresql.novice, skrev Tom Lane:
>  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.

Locale was set to:
lc_messages = 'en_US.iso885915'         # locale for system error
message string
s
lc_monetary = 'en_US.iso885915'         # locale for monetary formatting
lc_numeric = 'en_US.iso885915'          # locale for number formatting
lc_time = 'en_US.iso885915'                     # locale for time
formatting

I'll try re-initdb to locale C in the weekend.. this requires dump and
restore right?


Jesper


--
./Jesper Krogh, jesper@krogh.cc
Jabber ID: jesper@jabbernet.dk


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

Предыдущее
От: Kunal
Дата:
Сообщение: Re: MySQL vs PostgreSQL
Следующее
От: Frank Kurzawa
Дата:
Сообщение: relation column in pg_locks