Problem with index using regular expression

Поиск
Список
Период
Сортировка
От Håvard Wahl Kongsgård
Тема Problem with index using regular expression
Дата
Msg-id BANLkTi=2jJ8rAp-92==mzxpSABdHZ8vv+g@mail.gmail.com
обсуждение исходный текст
Ответы Re: Problem with index using regular expression  (Federico Di Gregorio <federico.digregorio@dndg.it>)
Список psycopg
Hi, with psycopg 2-2.4.1 I have some issue with incorrect use of indexes using regular expression.
I my case I have create on index on the surname of users. 
CREATE INDEX  income_surname ON income(substring(income.name from E'\\w.*\\s(\\w.*)$|\\w+\\s(\\w.*)$'))

then used
SELECT Distinct On (nodes.id) nodes.ID from nodes inner join income on substring(nodes.name from E'\\w.*\\s(\\w.*)$|\\w+\\s(\\w.*)$') = substring(income.name from E'\\w.*\\s(\\w.*)$|\\w+\\s(\\w.*)$')

with psql the index works fine, but with psycopg I don't think it's used at all. The index substring has to be identical with the substring in the query. Are there some encoding issues with psycopg?

--
Håvard Wahl Kongsgård

http://havard.security-review.net/

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

Предыдущее
От: Daniele Varrazzo
Дата:
Сообщение: Re: Installing via pip under Win7 + virtualenv + VC++2008
Следующее
От: Federico Di Gregorio
Дата:
Сообщение: Re: Problem with index using regular expression