Operator classes

An operator class is a set of function names that is associated with a secondary-access method. These functions allow the secondary-access method to store and search for values of a particular data type.

The query optimizer for the database server uses an operator class to determine if an index can process the query with the least cost. An operator class indicates two things to the query optimizer:
  • Which functions that appear in an SQL statement can be evaluated with a given index

    These functions are called the strategy functions for the operator class.

  • Which functions the index uses to evaluate the strategy functions

    These functions are called the support functions for the operator class.

With the information that the operator class provides, the query optimizer can determine whether a given index is applicable to the query. The query optimizer can consider whether to use the index for the given query when the following conditions are true:
  • An index exists on the particular column or columns in the query.
  • For the index that exists, the operation on the column or columns in the query matches one of the strategy functions in the operator class associated with the index.

The query optimizer reviews the available indexes for the table or tables and matches the index keys with the column specified in the query filter. If the column in the filter matches an index key, and the function in the filter is one of the strategy functions of the operator class, the optimizer includes the index when it determines which query plan has the lowest execution cost. In this manner, the optimizer can determine which index can process the query with the least cost.

Informix® stores information about operator classes in the sysopclasses system catalog table.


Copyright© 2019 HCL Technologies Limited