The ADMIN_EST_INLINE_LENGTH function returns an estimate of the inline length that is required to inline the data stored in an XML column, BLOB column, CLOB column, or DBCLOB column.
If the data cannot be inlined, the function returns a negative value.
If the data is already inlined, the function returns the actual length of the inlined data.
This function returns either an INTEGER value that represents the estimated inline length (in bytes) of the data, or one of the following values:
Example 1: The following example returns the estimated inline length of three XML documents that are contained in XML column xml_doc1 of TAB1 table.
db2 => SELECT PK, ADMIN_IS_INLINED(xml_doc1) as IS_INLINED,
ADMIN_EST_INLINE_LENGTH(xml_doc1) as EST_INLINE_LENGTH
from TAB1
This query results in the following output:
PK IS_INLINED EST_INLINE_LENGTH
----------- ---------- -----------------
1 1 292
2 0 450
3 0 454
3 record(s) selected.
In the example, the ADMIN_IS_INLINED function indicates that the first document is inlined. Therefore, the ADMIN_EST_INLINE_LENGTH function returns the actual length of the inlined XML document. The second document is not inlined, so the ADMIN_EST_INLINE_LENGTH function returns the estimated inline length that is required to inline the second XML document.
Example 2: The following example returns the estimated inline length of one XML document that is contained in the XML column xml_doc1 of the TAB1 table. This example includes a predicate.
db2 => SELECT PK, ADMIN_IS_INLINED(xml_doc1) as IS_INLINED,
ADMIN_EST_INLINE_LENGTH(xml_doc1) as EST_INLINE_LENGTH
from TAB1 where PK=2
This query results in the following output:
PK IS_INLINED EST_INLINE_LENGTH
----------- ---------- -----------------
2 0 450
1 record(s) selected.
Example 3: The following example returns the estimated inline length of three CLOB data that are contained in CLOB column clob_1 of the TAB1 table.
db2 => SELECT PK, ADMIN_IS_INLINED(clob_1) as IS_INLINED,
ADMIN_EST_INLINE_LENGTH(clob_1) as EST_INLINE_LENGTH
from TAB1
This query results in the following output:
PK IS_INLINED EST_INLINE_LENGTH
----------- ---------- -----------------
1 1 68
2 0 3665
3 0 -1
3 record(s) selected.
Page size | Row size limit | Inline length limit |
---|---|---|
4K | 4005 | 4001 |
8K | 8101 | 8097 |
16K | 16 293 | 16 289 |
32K | 32 677 | 32 673 |