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/