The Size function

The R-tree access method uses the Size function to evaluate different ways to group objects by comparing the sizes of bounding boxes around objects or groups of objects. It does this when it decides where to place a new data object and when it splits a page. Ideally, a disk page is divided into two pages whose overall bounding boxes are as compact and small as possible.

For sample C code of the Size function, see Size support function. C code uses the DataBlade® API to interact with the database server.

The SQL signature of the Size support function must be:
Size (UDT, DOUBLE PRECISION) RETURNS INTEGER

UDT refers to user-defined type, or the data type you want to index with the R-tree access method.

Write the Size function to calculate the relative size of the bounding box of the object in the first parameter and to store the result in the second parameter as a double-precision value.

The return value of the Size function is not used by the R-tree access method. The Size function should call the mi_db_error_raise() DataBlade API function to return errors.