The RtreeInfo function

The RtreeInfo support function defines the switching semantics for the strategy functions in your DataBlade® module. The R-tree access method calls the RtreeInfo function, if it exists, to determine, for a given strategy function, which strategy function it should actually call when working on an internal nonleaf page.

Earlier versions of the R-tree access method required DataBlade module strategy functions to test whether a page stored a bounding box or not to determine if that page was a leaf page or an internal page (only internal pages used to store bounding boxes). In the current version of the R-tree access method, if your DataBlade module implements the RtreeInfo function with the strat_func_substitutions operation, by default, indexes are created as bounding-box-only R-tree indexes; leaf pages store only bounding boxes (and not data objects).

For this version of the R-tree access method, if you are supporting bounding-box-only indexes, you must use a different method to specify how strategy functions behave when called on an internal nonleaf page or on a leaf page. To better understand why you might want your strategy function to behave differently on an internal nonleaf page or on a leaf page, see the following example and Internal uses of the strategy functions. This section describes why each of the four required strategy functions sometimes uses different strategy functions on internal nonleaf pages and which function is actually used on the internal nonleaf pages. If necessary, you must redesign your strategy functions if you want them to behave differently for leaf and nonleaf pages. This is because you cannot distinguish between leaf and nonleaf items in a bounding-box-only index.

For example, suppose you have a strategy function in slot 5 named MyEqual, which is a variation on the Equal function. When this function is called on a nonleaf page, you want it to behave like Contains; you cannot eliminate nonleaf items by testing their bounding boxes for equality, because the test is too stringent. But when MyEqual is called on a leaf page, you do want it to test for equality. If the leaf pages contain the complete objects (the index is not a bounding-box-only index), you can implement this behavior switch yourself in the MyEqual function by checking to see if one or both operands are bounding boxes. However, with a bounding-box-only index, the leaf pages hold only the objects' bounding boxes. In this case, an implementation of MyEqual, which performs a Contains check whenever it is called with bounding boxes, would be inefficient because it would force the R-tree access method to make the extra step of retrieving a complete object from the table. Instead, a candidate data object could be eliminated immediately by performing an equality check on its leaf page bounding box.

To detect whether the operands are leaf or nonleaf data, and switch behavior accordingly, use the RtreeInfo support function, as described in this section, or design your own strategy functions to make this determination.
Important: If you create an RtreeInfo support function that defines the switching semantics of your strategy functions, you must modify your DataBlade module code to ensure that the strategy functions in slots 5 and up do not try to determine whether they are being executed on an internal or leaf page based on whether the input is a bounding box.
Important: If the R-tree access method detects an RtreeInfo support function that implements the strat_func_substitutions operation, the R-tree access method sets the default mode of index creation to bounding-box-only.

The R-tree access method checks for the RtreeInfo function when it creates an R-tree index and updates the root page with the information. This means that if you create an RtreeInfo support function that defines the switching semantics of your strategy functions, you must update existing R-tree indexes so they know about it.

Use the oncheck utility to update any existing indexes, using the following syntax:
oncheck -ci -u "info_anchor_update"
{database[:[owner.]table[,fragdbs|#index]]}