Are indexes used with LIKE?

Поиск
Список
Период
Сортировка
От Kovács Péter
Тема Are indexes used with LIKE?
Дата
Msg-id 43D527B1.1030905@chemaxon.hu
обсуждение исходный текст
Ответы Re: Are indexes used with LIKE?  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-general
Hi,

Are indexes on VARCHAR columns used with the LIKE operator, and if so,
how efficiently are they used?

I can imagine that using indexes can be easy with the starting literal
characters up to the first percent sign such as in:

LIKE 'ZOE%QQWE%'

But, after the first % sign, things can get more difficult.

The reason I am asking is that we are thinking about discriminating
between rows of a table based on a VARCHAR column containing various
one-character "flags". We could then use the LIKE operator for
formulating filter conditions.

Any help is appreciated!

Regards
Peter

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

Предыдущее
От: Vivek Khera
Дата:
Сообщение: Re: RAID 5 and postgresql
Следующее
От: Tom Lane
Дата:
Сообщение: Re: invalid memory alloc request size