Compressing your data
You can 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
You can use the DSN1COMP utility to determine how well compression of your data will work. Data in a LOB table space or a table space that is defined in the work file database (the table space for declared temporary tables) cannot be compressed. For more information, see DSN1COMP.
The CPU cost of both compression and decompression increases with smaller compression ratios. Therefore, it is best to avoid the use of compression if the compression ratio, or the percentage of saved space due to compression, is less than 10 - 20 percent. The additional CPU cost for compression and decompression makes it not worthwhile.
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. Computer processing is required to compress data before it is stored and to decompress the data when it is retrieved from storage. In many cases, using the COMPRESS clause 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
To compress data: