|
1 | 1 | <!--
|
2 |
| -$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_index.sgml,v 1.27 2002/03/22 19:20:38 petere Exp $ |
| 2 | +$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_index.sgml,v 1.28 2002/04/11 23:20:04 momjian Exp $ |
3 | 3 | PostgreSQL documentation
|
4 | 4 | -->
|
5 | 5 |
|
@@ -76,9 +76,10 @@ CREATE [ UNIQUE ] INDEX <replaceable class="parameter">index_name</replaceable>
|
76 | 76 | <term><replaceable class="parameter">acc_method</replaceable></term>
|
77 | 77 | <listitem>
|
78 | 78 | <para>
|
79 |
| -The name of the access method to be used for |
80 |
| -the index. The default access method is <literal>BTREE</literal>. |
81 |
| -<application>PostgreSQL</application> provides four access methods for indexes: |
| 79 | +The name of the access method to be used for the index. The |
| 80 | +default access method is <literal>BTREE</literal>. |
| 81 | +<application>PostgreSQL</application> provides four access |
| 82 | +methods for indexes: |
82 | 83 |
|
83 | 84 | <variablelist>
|
84 | 85 | <varlistentry>
|
@@ -225,26 +226,27 @@ ERROR: Cannot create index: 'index_name' already exists.
|
225 | 226 | </para>
|
226 | 227 |
|
227 | 228 | <para>
|
228 |
| - In the second syntax shown above, an index is defined |
229 |
| - on the result of a user-specified function |
230 |
| - <replaceable class="parameter">func_name</replaceable> applied |
231 |
| - to one or more columns of a single table. |
232 |
| - These <firstterm>functional indexes</firstterm> |
233 |
| - can be used to obtain fast access to data |
234 |
| - based on operators that would normally require some |
235 |
| - transformation to apply them to the base data. |
| 229 | + In the second syntax shown above, an index is defined on the result |
| 230 | + of a user-specified function <replaceable |
| 231 | + class="parameter">func_name</replaceable> applied to one or more |
| 232 | + columns of a single table. These <firstterm>functional |
| 233 | + indexes</firstterm> can be used to obtain fast access to data based |
| 234 | + on operators that would normally require some transformation to apply |
| 235 | + them to the base data. For example, a functional index on |
| 236 | + <literal>upper(col)</> would allow the clause |
| 237 | + <literal>WHERE upper(col) = 'JIM'</> to use an index. |
236 | 238 | </para>
|
237 | 239 |
|
238 | 240 | <para>
|
239 |
| - <application>PostgreSQL</application> provides B-tree, R-tree, hash, and GiST access methods for |
240 |
| - indexes.The B-tree access method is an implementation of |
241 |
| - Lehman-Yao high-concurrency B-trees.The R-tree access method |
242 |
| - implements standard R-trees using Guttman's quadratic split algorithm. |
243 |
| - The hash access method is an implementation of Litwin's linear |
244 |
| - hashing.We mention the algorithms used solely to indicate that all |
245 |
| - of these access methods are fully dynamic and do not have to be |
246 |
| - optimized periodically (as is the case with, for example, static hash |
247 |
| - access methods). |
| 241 | + <application>PostgreSQL</application> provides B-tree, R-tree, hash, |
| 242 | +and GiST access methods forindexes. The B-tree access method is an |
| 243 | +implementation ofLehman-Yao high-concurrency B-trees. The R-tree |
| 244 | +access methodimplements standard R-trees using Guttman's quadratic |
| 245 | +split algorithm.The hash access method is an implementation of |
| 246 | +Litwin's linearhashing. We mention the algorithms used solely to |
| 247 | +indicate that allof these access methods are fully dynamic and do |
| 248 | +not have to beoptimized periodically (as is the case with, for |
| 249 | +example, static hashaccess methods). |
248 | 250 | </para>
|
249 | 251 |
|
250 | 252 | <para>
|
@@ -338,18 +340,18 @@ ERROR: Cannot create index: 'index_name' already exists.
|
338 | 340 |
|
339 | 341 | <para>
|
340 | 342 | An <firstterm>operator class</firstterm> can be specified for each
|
341 |
| - column of an index.The operator class identifies the operators to |
342 |
| -beused by the index for that column. For example, a B-tree index on |
| 343 | + column of an index. The operator class identifies the operators to be |
| 344 | + used by the index for that column. For example, a B-tree index on |
343 | 345 | four-byte integers would use the <literal>int4_ops</literal> class;
|
344 | 346 | this operator class includes comparison functions for four-byte
|
345 |
| - integers.In practice the default operator class for the field's |
346 |
| -datatype is usually sufficient. The main point of having operator classes |
| 347 | + integers. In practice the default operator class for the field's data |
| 348 | + type is usually sufficient. The main point of having operator classes |
347 | 349 | is that for some data types, there could be more than one meaningful
|
348 |
| - ordering.For example, we might want to sort a complex-number data type |
349 |
| - either by absolute value or by real part.We could do this by defining |
350 |
| - two operator classes for the data type and then selecting the proper |
351 |
| - class when making an index.There are also some operator classes with |
352 |
| - special purposes: |
| 350 | + ordering. For example, we might want to sort a complex-number data |
| 351 | +typeeither by absolute value or by real part. We could do this by |
| 352 | +definingtwo operator classes for the data type and then selecting |
| 353 | +the properclass when making an index. There are also some operator |
| 354 | +classes withspecial purposes: |
353 | 355 |
|
354 | 356 | <itemizedlist>
|
355 | 357 | <listitem>
|
|