Using an Operator Class

An operator class is the set of operators associated with a secondary-access method for query optimization and building the index. You must specify an operator class when you create an index if either one of the following is true:
  • No default operator class for the secondary-access method exists. (A user-defined access method can provide no default operator class.)
  • You want to use an operator class that is different from the default operator class that the secondary-access method provides.
If you use an alternative access method, and if the access method has a default operator class, you can omit the operator class here; but if you do not specify an operator class and the secondary-access method does not have a default operator class, the database server returns an error. For more information, see Default Operator Classes. The following CREATE INDEX statement creates a B-tree index on the cust_tab table that uses the abs_btree_ops operator class for the cust_num key:
CREATE INDEX c_num1_ix ON cust_tab (cust_num abs_btree_ops);