Docs off on ILIKE indexing?

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Docs off on ILIKE indexing?
Date: 2006-01-16 17:04:52
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCE6C7E9A@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-01-16 17:07:44 Re: ScanKey representation for RowCompare index conditions
Previous Message Tom Lane 2006-01-16 16:57:50 Re: ScanKey representation for RowCompare index conditions