Inlined and compressed XML storage
If some or all of your XML documents are small enough to fit into their corresponding row on the base table page in the DAT objects, they can be inlined into the relational data row. This provides more direct access to the XML data and avoids the redirected access to the XDA objects. In case of XML documents are too large to be inlined, they are stored in the XDA objects as usual.
Advantages of replacing the XML tags with an integer includes:
- Inlined documents do not require any region index entries hence reducing size of region index dramatically.
- Inlined documents can be compressed with DB2 row compression feature.
Operations
Refer to the example on the right.
- Defines the XML column with the option INLINE LENGTH 3000. Any document in 3000 bytes or less are inlined.
- Both the relational data and the inlined XML documents are compressed because COMPRESS YES is specified.
Note that the CREATE TABLESPACE statements may fail if they already exist in the database. If that's the case, you may ignore those errors.