Clarify use of btree indexes for ILIKE and ~*.
authorBruce Momjian <bruce@momjian.us>
Wed, 18 Jan 2006 22:26:01 +0000 (22:26 +0000)
committerBruce Momjian <bruce@momjian.us>
Wed, 18 Jan 2006 22:26:01 +0000 (22:26 +0000)
doc/src/sgml/indices.sgml

index 2040c9808423b6d104fc68ead8e415b7c0908400..915fb5fb3b58cad476f05eca78548c8a57b6a47d 100644 (file)
@@ -141,17 +141,21 @@ CREATE INDEX test1_id_index ON test1 (id);
 
   <para>
    The optimizer can also use a B-tree index for queries involving the
-   pattern matching operators <literal>LIKE</>,
-   <literal>ILIKE</literal>, <literal>~</literal>, and
-   <literal>~*</literal>, <emphasis>if</emphasis> the pattern is a constant
-   and is anchored to the beginning of the string &mdash; for example,
-   <literal>col LIKE 'foo%'</literal> or <literal>col ~ '^foo'</literal>,
-   but not <literal>col LIKE '%bar'</literal>.  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 <xref linkend="indexes-opclass"> below.
+   pattern matching operators <literal>LIKE</> and <literal>~</literal>
+   <emphasis>if</emphasis> the pattern is a constant and is anchored to
+   the beginning of the string &mdash; for example, <literal>col LIKE
+   'foo%'</literal> or <literal>col ~ '^foo'</literal>, but not
+   <literal>col LIKE '%bar'</literal>. 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
+   <xref linkend="indexes-opclass"> below. It is also possible to use
+   B-tree indexes for <literal>ILIKE</literal> and
+   <literal>~*</literal>, but only if the pattern starts with
+   non-alphabetic characters, i.e. characters that are not affected by
+   upper/lower case conversion.
   </para>
 
+
   <para>
    <indexterm>
     <primary>index</primary>