From: Bruce Momjian Date: Wed, 18 Jan 2006 22:26:01 +0000 (+0000) Subject: Clarify use of btree indexes for ILIKE and ~*. X-Git-Url: http://waps.l3s.uni-hannover.de/gitweb/?a=commitdiff_plain;h=157003abde8e7792406e247b6892fa7647a034f2;p=users%2Fbernd%2Fpostgres.git Clarify use of btree indexes for ILIKE and ~*. --- diff --git a/doc/src/sgml/indices.sgml b/doc/src/sgml/indices.sgml index 2040c98084..915fb5fb3b 100644 --- a/doc/src/sgml/indices.sgml +++ b/doc/src/sgml/indices.sgml @@ -141,17 +141,21 @@ CREATE INDEX test1_id_index ON test1 (id); 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'. However, if your server does - not use the C locale you will need to create the index with a - special operator class to support indexing of pattern-matching queries. - See below. + pattern matching operators LIKE 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'. However, if your server does not + use the C locale you will need to create the index with a special + operator class to support indexing of pattern-matching queries. See + below. It is also possible to use + B-tree indexes for ILIKE and + ~*, but only if the pattern starts with + non-alphabetic characters, i.e. characters that are not affected by + upper/lower case conversion. + index