Re: How to get fast ~ operator using C locale

Поиск
Список
Период
Сортировка
От Dimitri Fontaine
Тема Re: How to get fast ~ operator using C locale
Дата
Msg-id 200707051359.41628.dfontaine@hi-media.com
обсуждение исходный текст
Ответ на How to get fast ~ operator using C locale  ("Artur Rataj" <arturrataj@gmail.com>)
Ответы Re: How to get fast ~ operator using C locale  ("Artur Rataj" <arturrataj@gmail.com>)
Список pgsql-general
Hi,

Le jeudi 05 juillet 2007, Artur Rataj a écrit :
> Hello, I want to have pg use fast indexing for ~ operator. Is setting
> C locale for this is still necessary? If yes, is it enough to
> initdb/createdb with C locale? If it is not enough, why setting locale
> to C and starting postmaster still gives other locale, for example,
> pl_PL, in
> postmaster log "initial environ dump"?

It seems to me this page of the fine manual could match:

http://www.postgresql.org/docs/8.2/static/indexes-opclass.html

The operator classes text_pattern_ops, varchar_pattern_ops,
bpchar_pattern_ops, and name_pattern_ops support B-tree indexes on the types
text, varchar, char, and name, respectively. The difference from the default
operator classes is that the values are compared strictly character by
character rather than according to the locale-specific collation rules. This
makes these operator classes suitable for use by queries involving pattern
matching expressions (LIKE or POSIX regular expressions) when the server does
not use the standard "C" locale. As an example, you might index a varchar
column like this:
CREATE INDEX test_index ON test_table (col varchar_pattern_ops);

Regards,
--
dim

Вложения

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

Предыдущее
От: "Artur Rataj"
Дата:
Сообщение: How to get fast ~ operator using C locale
Следующее
От: "Artur Rataj"
Дата:
Сообщение: Re: How to get fast ~ operator using C locale