v0.9.2 Summary Chapter 3: Database objects 3. Introduction 3.23. Operator classes

3.23. Operator classes

Operator classes defines how a specific data type can be handled by indexes. This kind of object specifies a set of elements composed by operators, functions or storage modes that will fill a particular role or strategy when dealing with the data type combined to the index access method.

Attribute Description
Indexing Index access method used by the operator class. Possible values are btree, gin, gist, hash, spgist and brin.
Default Class Indicates that the operator class is the default for the specified data type and index access method.
Operator Family Defines the operator family in which the operator class will be included. Details about operator families can be seen on the next section Operator families.
Data Type Data type in which operator class works.
Elements The group of fields that is is used to configure the operator class elements. These objects are detailed in the next subsection.

3.20.1. Operator class elements

Operator class elements are the small unit of an operator class. In order to create a valid operator class at least one element must exist. These objects can be constructed using an operator, function or storage data type as detailed in the table below.

Attribute Description
Element Type Type of the current element. It can be: Operator, Function or Storage.
Operator Indicates the operator to be associated to the current element.
Operator Family Defines the btree operator family that specifies the sorting mode of an ordering operator. This attribute is used only when you want to create an element with data sorting properties.
Function Defines the function used as the index method support for the operator class.
Storage Type Specifies the data type that is in fact stored in the index. Generally, this is the same as the column data type. But there are some index access methods (like GiST and GIN) that allows this type to be overridden.
Support / Strategy When the element being configured uses an operator this attribute is the index method's strategy number. Now, when the element is using a function this is the index method's support procedure number. The value specified here is defined by each index access method used.

** Operator class DDL **


** More about operator classes **


Jan 3, 2020 at 12:33