Re: case-insensitive Index

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: case-insensitive Index
Дата
Msg-id 26019.1153320838@sss.pgh.pa.us
обсуждение исходный текст
Ответ на case-insensitive Index  ("Verena Ruff" <lists@triosolutions.at>)
Ответы Re: case-insensitive Index  ("Verena Ruff" <lists@triosolutions.at>)
Список pgsql-novice
"Verena Ruff" <lists@triosolutions.at> writes:
> EXPLAIN SELECT * FROM kundepersonhc WHERE UPPER(pers_nachname) LIKE
> UPPER('me%');
> says that a seq scan is done.

> I used this statement to define the index:
> CREATE INDEX kundepersonhc_upper_pers_nachname ON kundepersonhc
> (UPPER(pers_nachname));

If your locale is not C then you'd need to specify a special index
opclass while creating the index in order to let it support LIKE
queries, eg

CREATE INDEX kundepersonhc_upper_pers_nachname ON kundepersonhc
(UPPER(pers_nachname) text_pattern_ops);

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

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Query optimization / automatic re-ordering of tables
Следующее
От: "Verena Ruff"
Дата:
Сообщение: Re: case-insensitive Index