Maximum size of the user-defined data type

A copy of the data object is stored as part of the key in the leaf pages of an R-tree index. Each index page is a database disk page. R-tree index entries, however, cannot span disk pages as table rows can.

Therefore, the maximum size of a data object that is stored in a table, and thus the maximum size of its user-defined data type, is governed by the R-tree disk page size of 2 KB. After allowing for R-tree index overhead, about 1960 bytes, minus the size in bytes of the bounding box of the data object, are available.

Furthermore, R-tree indexes should always fit at least two keys on a single leaf page. Although the R-tree index works correctly with just one key per leaf page, the index performs better when two or more keys fit on single page. This means that the maximum size, in bytes, of a user-defined data type that is to be indexed with an R-tree index should optimally be:
(2000 - B - (K * 20)) / K
In the formula, B refers to the size, in bytes, of the bounding box of the data object, and K refers to the number of keys you want to fit on a page. For example, if you want to fit three keys on a single page, then the maximum size of the data type is:
(1940 - B) / 3

Although this maximum size might be sufficient to store simple boxes and circles, it is probably not sufficient to store very large polygons. DataBlade® modules that create user-defined data types that store very large values must implement them as either smart large objects or multirepresentational data types. Multirepresentational user-defined data types store a value in the table if it is smaller than the maximum size of the user-defined data type, or in a smart large object otherwise. There is no size limitation on smart large objects or multirepresentational data types.