Create an operator class
For most indexing, the operators in the default operator class of a secondary-access method provide adequate support. However, when you want to order the data in a different sequence than the default operator class provides, you can define a new operator class for the secondary-access method.
- The name of the operator class
- The name of the secondary-access method with which to associate the functions of the operator class
- The names and, optionally, the parameters of the strategy functions
- The names of the support functions
The database server stores this information in the sysopclasses system catalog table. You must have the Resource privilege for the database or be the DBA to create an operator class.
CREATE OPCLASS new_btree_ops FOR btree
STRATEGIES (lessthan, lessthanorequal, equal,
greaterthanorequal, greaterthan)
SUPPORT(compare);
For more information, see Generic B-tree index.
- The generic B-tree secondary-access method
A new operator class can provide an additional sort order for all data types that the B-tree index can handle.
- Any user-defined secondary-access methods
A new operator class can provide additional functionality to the strategy functions of the operator class.