+ class="parameter">func_name applied to one or more
+ columns of a single table. These functional
+ indexes can be used to obtain fast access to data based
+ on operators that would normally require some transformation to apply
+ them to the base data. For example, a functional index on
+ upper(col)> would allow the clause
+ WHERE upper(col) = 'JIM'> to use an index.
-
PostgreSQL provides B-tree, R-tree, hash,
and GiST access methods for
- indexes. The B-tree access method is an implementation of
- Lehman-Yao high-concurrency B-trees. The R-tree access method
- implements standard R-trees using Guttman's quadratic split algorithm.
- The hash access method is an implementation of Litwin's linear
- hashing. We mention the algorithms used solely to indicate that all
- of these access methods are fully dynamic and do not have to be
- optimized periodically (as is the case with, for example, static hash
- access methods).
+
PostgreSQL provides B-tree, R-tree, hash,
+ and GiST access methods for indexes. The B-tree access method is an
+ implementation of Lehman-Yao high-concurrency B-trees. The R-tree
+ access method implements standard R-trees using Guttman's quadratic
+ split algorithm. The hash access method is an implementation of
+ Litwin's linear hashing. We mention the algorithms used solely to
+ indicate that all of these access methods are fully dynamic and do
+ not have to be optimized periodically (as is the case with, for
+ example, static hash access methods).
An operator class can be specified for each
- column of an index. The operator class identifies the operators to
- be used by the index for that column. For example, a B-tree index on
+ column of an index. The operator class identifies the operators to be
+ used by the index for that column. For example, a B-tree index on
four-byte integers would use the int4_ops class;
this operator class includes comparison functions for four-byte
- integers. In practice the default operator class for the field's
- data type is usually sufficient. The main point of having operator classes
+ integers. In practice the default operator class for the field's data
+ type is usually sufficient. The main point of having operator classes
is that for some data types, there could be more than one meaningful
- ordering. For example, we might want to sort a complex-number data type
- either by absolute value or by real part. We could do this by defining
- two operator classes for the data type and then selecting the proper
- class when making an index. There are also some operator classes with
- special purposes:
+ ordering. For example, we might want to sort a complex-number data
+ type either by absolute value or by real part. We could do this by
+ defining two operator classes for the data type and then selecting
+ the proper class when making an index. There are also some operator
+ classes with special purposes: