DB2 Version 10.1 for Linux, UNIX, and Windows

Row compression rates and ease of use have improved

DB2® V10.1 features some major enhancements to row compression, including improved compression rates, improved ease of use, and higher data availability.

Adaptive compression

In DB2 V10.1, table data can be compressed with page-level compression dictionaries in addition to the table-level compression dictionary used in earlier versions of the product. In this compression scheme, each page of table data has a page-level compression dictionary that takes into account all of the data that exists within the page. Page-level compression dictionaries are automatically maintained; when there are changes to data in a page, the compression dictionary is dynamically updated. This means that you do not need to perform a table reorganization to compress data on that page. Thus, in addition to improved compression rates, this approach to compression can improve the availability of your data. This method of compressing data rows with both table-level and the automatically updated page-level compression dictionaries is known as adaptive compression.

Enabling adaptive compression

You can enable adaptive compression by using the COMPRESS YES ADAPTIVE clause in the CREATE TABLE and ALTER TABLE statements.
Note: The ADAPTIVE keyword is now the default option for the COMPRESS YES clause.
For a table enabled to use adaptive compression, rows are compressed during the following data change operations:
  • Inserts
  • Updates
  • Imports
  • Loads
  • Redistributes
  • Reorgs
  • Online table moves

After adaptive compression is enabled for a table with existing data, rows that are subsequently inserted might trigger the creation of additional page-level dictionaries as new data is added.