Operator classes on user-defined data types

When you create an opaque data type, you can write operator-class functions to do the following:
  • Extend the default operator class for an existing secondary-access method to handle the indexing scheme that these operators support.

    You write operator-class functions with the same names as those in the existing operator class. These functions extend the existing operator class by implementing its indexing scheme on the opaque data type. The query optimizer can choose an index on this data type when the index uses this operator class and the SQL statement contains one of the operators in this operator class.

    Because of routine overloading, these functions can have the same name as the functions in the default operator class. For more information about routine overloading, refer to Routine overloading.

  • Define a new operator class to provide an entirely new set of operators that operate on the opaque type.

    You supply the support and strategy functions that the access method requires. These functions define the new operators that the query optimizer can recognize as associated with the secondary-access method. The requirements for the support and strategy functions vary from one access method to another. You must consult the documentation for the access method before defining a new operator class.