I have a table with a CLOB(1M)
. If I enable compression (compression yes adaptive
) on the the table the CLOB is not compressed. Is there a way to make this work in DB2 10.5?
DB2 10.5 – How to Compress CLOB Columns
compressiondb2db2-10.5db2-luw
Related Question
- DB2 DDL – How to Change Column from NOT LOGGED to LOGGED
- DB2 – Why Cannot Create Database with Keyword ‘BACKUP’?
- Db2 – How to identify overflow rows in DB2 LUW
- Backup DB2 – How to Determine Free Space Needed for DB2 Backup File
- DB2 10.5 – Stored Procedure Question
- COMPRESS TABLESPACE 11g
- DB2 – Equivalent of Oracle DBMS_LOB.SUBSTR
Best Answer
Historically LOB data are stored in data structures separate from the normal row data, these data structures are not compressed. With Db2 for LUW 9.7 and later you have an option to store part of LOB columns, subject to the row length limitation, inline with data rows. Inline LOB data will be compressed along with the rows they belong to.
This is only helpful if the majority of your LOB values fall within the inline length limit. Note also that storing LOBs inline can have impact on query performance (fewer rows fit on a page, thus potentially increasing I/O demand) and logging overhead (inlined LOBs are always logged).