Using Huffman compression to compress your data
With IBM z14®, Db2 can use Huffman compression to reduce the space required for a table by using data compression. Compressing the data in a table space can significantly reduce the amount of disk space that is needed to store data and can help improve buffer pool performance.
Before you begin
FL 504The TS_COMPRESSION_TYPE subsystem parameter specifies the default compression algorithm that is used to compress Db2 data at the subsystem level.
FL 509 The COMPRESS option of the ALTER TABLESPACE, CREATE TABLE, and CREATE TABLESPACE statements can define the compression algorithm that is used to compress Db2 data at the table space or partition level.
You can use the DSN1COMP utility to determine how well compression of your data will work.
- The Db2 subsystem or data sharing group must be running on IBM z14 or later
- The function level must be V12R1M504 or later
- The table space to be compressed is a universal table space
- Any of the following are true:
- The table space is defined with the COMPRESS YES clause and the TS_COMPRESSION_TYPE subsystem parameter is set to HUFFMAN
- FL 509 The table space is defined with the COMPRESS YES HUFFMAN clause
Table spaces that are defined with the ORGANIZE BY HASH clause cannot be compressed.
About this task
When you compress data, bit strings that occur frequently are replaced by shorter strings. Information about the mapping of bit strings to their replacements is stored in a compression dictionary. Huffman compression uses IBM z14 hardware to compress data before it is stored and to decompress the data that is retrieved from a page in the buffer pool. In many cases, using Huffman compression can significantly reduce the amount of disk space needed to store data, but the compression ratio that you achieve depends on the characteristics of your data.
- Higher buffer pool hit ratios
- Fewer I/Os
- Fewer getpage operations
Procedure
If the requirements for Huffman compression are met, the following actions will compress Db2 data using IBM z14 Huffman compression: