Re: Using regular expressions in LIKE

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: Using regular expressions in LIKE
Дата
Msg-id
22683.1074184091@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
Using regular expressions in LIKE Együd Csaba <csegyud@vnet.hu>
Re: Using regular expressions in LIKE <terry@ashtonwoodshomes.com>
Re: Using regular expressions in LIKE Együd Csaba <csegyud@vnet.hu>
Re: Using regular expressions in LIKE <terry@ashtonwoodshomes.com>
Re: Using regular expressions in LIKE Együd Csaba <csegyud@vnet.hu>
Karsten Hilbert  writes:
>> Regexes are optimized the same way as equivalent LIKE expressions.  In
>> particular, the pattern has to be left-anchored to consider using it
>> with an index.  In LIKE that means no wildcard at the start of the
>> pattern, in regex it means there has to be a ^.

> What about "^.*oobar" in a regex ? I mean, it seems impossible
> to use an index on that, right ?

Right.  You need ^ immediately followed by some constant text.  The
planner extracts the "fixed prefix" of the pattern to use with the index.

			regards, tom lane
В списке pgsql-general по дате отправления
От: Terry Lee Tucker
Дата:
Сообщение: Re: Foreign key question
От: Melanie Bergeron
Дата:
FAQ