|
1 |
| -<!-- $PostgreSQL: pgsql/doc/src/sgml/indices.sgml,v 1.55 2005/11/07 17:36:44 tgl Exp $ --> |
| 1 | +<!-- $PostgreSQL: pgsql/doc/src/sgml/indices.sgml,v 1.56 2006/01/18 21:29:45 momjian Exp $ --> |
2 | 2 |
|
3 | 3 | <chapter id="indexes">
|
4 | 4 | <title id="indexes-title">Indexes</title>
|
@@ -141,17 +141,21 @@ CREATE INDEX test1_id_index ON test1 (id);
|
141 | 141 |
|
142 | 142 | <para>
|
143 | 143 | The optimizer can also use a B-tree index for queries involving the
|
144 |
| - pattern matching operators <literal>LIKE</>, |
145 |
| - <literal>ILIKE</literal>, <literal>~</literal>, and |
146 |
| - <literal>~*</literal>, <emphasis>if</emphasis> the pattern is a constant |
147 |
| - and is anchored to the beginning of the string — for example, |
148 |
| - <literal>col LIKE 'foo%'</literal> or <literal>col ~ '^foo'</literal>, |
149 |
| - but not <literal>col LIKE '%bar'</literal>. However, if your server does |
150 |
| - not use the C locale you will need to create the index with a |
151 |
| - special operator class to support indexing of pattern-matching queries. |
152 |
| - See <xref linkend="indexes-opclass"> below. |
| 144 | + pattern matching operators <literal>LIKE</> and <literal>~</literal> |
| 145 | + <emphasis>if</emphasis> the pattern is a constant and is anchored to |
| 146 | + the beginning of the string — for example, <literal>col LIKE |
| 147 | + 'foo%'</literal> or <literal>col ~ '^foo'</literal>, but not |
| 148 | + <literal>col LIKE '%bar'</literal>. However, if your server does not |
| 149 | + use the C locale you will need to create the index with a special |
| 150 | + operator class to support indexing of pattern-matching queries. See |
| 151 | + <xref linkend="indexes-opclass"> below. It is also possible to use |
| 152 | + B-tree indexes for <literal>ILIKE</literal> and |
| 153 | + <literal>~*</literal>, but only if the pattern starts with |
| 154 | + non-alphabetic characters, i.e. characters that are not affected by |
| 155 | + upper/lower case conversion. |
153 | 156 | </para>
|
154 | 157 |
|
| 158 | + |
155 | 159 | <para>
|
156 | 160 | <indexterm>
|
157 | 161 | <primary>index</primary>
|
|
0 commit comments