Syntax for creating a new operator class
After you create all the required support and strategy functions, you are ready to create the operator class.
CREATE OPCLASS opclass
FOR RTREE
STRATEGIES (strategy, strategy, strategy, strategy [, strategy])
SUPPORT (support, support, support
{, support, support, support, support {,support}} );
The FOR RTREE clause indicates to the database server that the operator class is for use with the R-tree access method.
Arguments | Purpose | Restrictions |
---|---|---|
opclass | The name you want to give your operator class | The name must be unique in the database. |
strategy | The names of the strategy functions you previously created Four strategy functions are required; any others are optional. | You can list a maximum of 64 functions. You must include the following four strategy functions: Overlap, Equal, Contains, and Within. You can name them whatever you choose, but they must be listed as the first, second, third, and fourth functions, respectively. |
support | The names of the three required support functions you previously created; the four support functions for bulk-loading are optional. The support function RtreeInfo is also optional but must be in the eighth position if specified. | You must include the following three support functions: Union, Size, and Inter. You can name them whatever you choose, but they must be listed as the first, second, and third functions, respectively. You can optionally include the four bulk-loading support functions: SFCbits, ObjectLength, SFCvalue, and SetUnion. You can name them whatever you choose, but they must be listed as the fourth, fifth, sixth, and seventh functions, respectively. If you do not specify the four optional bulk-loading support functions and you do specify RtreeInfo, put NULL in positions four, five, six, and seven. |
If you use the Informix® DataBlade Developers Kit (DBDK) to create an operator class, you do not have to create the SQL statements to register the support and strategy functions with the database server because the DBDK automatically generates the necessary scripts. However, the DBDK does not automatically generate the SQL statement to create an operator class. Instead, you must create custom SQL files from BladeSmith by choosing .
CREATE OPCLASS MyShape_ops1
FOR RTREE
STRATEGIES (Overlap, Equal, Contains, Within)
SUPPORT (Union, Size, Inter);
The strategy functions are called Overlap, Equal, Contains, and Within. The support functions are called Union, Size, and Inter.
CREATE OPCLASS MyShape_ops2
FOR RTREE
STRATEGIES (Overlap, Equal, Contains, Within)
SUPPORT (Union, Size, Inter, SFCbits, ObjectLength, SFCvalue, SetUnion);
Note the additional optional bulk-loading support functions SFCbits, ObjectLength, SFCvalue, and SetUnion.
CREATE OPCLASS MyShape_ops3
FOR RTREE
STRATEGIES (Overlap, Equal, Contains, Within)
SUPPORT (Union, Size, Inter, NULL, NULL, NULL, NULL, RtreeInfo);
For more information about the CREATE OPCLASS statement, refer to the HCL Informix Guide to SQL: Syntax.
For more information about the DBDK and BladeSmith, refer to the HCL Informix DataBlade Developers Kit User's Guide.