Docs off on ILIKE indexing? - Mailing list pgsql-hackers

From Magnus Hagander
Subject Docs off on ILIKE indexing?
Date
Msg-id 6BCB9D8A16AC4241919521715F4D8BCE6C7E9A@algol.sollentuna.se
Whole thread Raw
Responses Re: Docs off on ILIKE indexing?
List pgsql-hackers
http://www.postgresql.org/docs/8.1/static/indexes-types.html

says:
The optimizer can also use a B-tree index for queries involving the
pattern matching operators LIKE, ILIKE, ~, and ~*, if the pattern is a
constant and is anchored to the beginning of the string - for example,
col LIKE 'foo%' or col ~ '^foo', but not col LIKE '%bar'.


But really, does it use indexes for ILIKE? (And I assume the same holds
for case insensitive regexp matching)

(If it does, can someone enlighten me on what I have to do - I have a
system with C locale that refuses to do it for ILIKE, but works just
fine for LIKE. My workaronud for now is to create an index on lower(foo)
and then use WHERE lower(foo) LIKE 'bar%' which works fine - but it does
require an extra index..)

So. Am I off, or are the docs? Or is it just me who can't read ;-)

//Magnus


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: ScanKey representation for RowCompare index conditions
Next
From: Tom Lane
Date:
Subject: Re: ScanKey representation for RowCompare index conditions