Creating a new B-tree operator class
About this task
To traverse the index structure, the generic B-tree index uses the sequence that the relational operators define. By default, a B-tree uses the lexicographical sequence of data because the default operator class, btree_ops, contains the relational-operator functions. (For more information about this sequence, see Change the sort order.) For a generic B-tree to use a different sequence for its index values, you can create a new operator class for the btree secondary-access method. You can then specify the new operator class when you define an index on that data type.
When you create a new operator class for the generic B-tree index, you provide an additional sequence for organizing data in a B-tree. When you create the B-tree index, you can specify the sequence that you want a column (or user-defined function) in the index to have.
To create a new operator class for a generic B-tree index:
Procedure
Results
These steps create the new operator class of the generic B-tree index. You can also extend the default operator class to provide support for new data types. For more information, see Extensions of the btree_ops operator class.
To use the new operator class, specify the name of the operator class after the column or function name in the CREATE INDEX statement.