In Db2, compression has been evolutionary, going back to the column compression days of Db2 for MVS, and later, the row compression algorithm Lempel-Ziv. Popular compression algorithms are lossless-based, meaning they remove repeating values when you deflate, or zip when data is stored and inflate or unzip when read. In this section, we are going to focus on V11.1 data compression, and specifically, table and index compression.
There are four types of compression in Db2. The following table lists the types of compression, with some details about each:
Object |
Dictionary |
Type |
Controlled |
Table |
Row |
Static |
ALTER/CREATE TABLE ... COMPRESS YES STATIC |
Table |
Column |
Adaptive |
Controlled by Db2. Cannot be changed by user. |
Table |
Value |
Value |
ALTER/CREATE TABLE VALUE COMPRESSION |
Page |
Page and row |
Adaptive |
Compression of the page... |