Db2 for z/OS - The AI Database



DSN1COMP now estimates the effectiveness of compressing data with IBM z14 Hardware based Huffman encoding

By Paul McWilliams posted 27 days ago


In Db2 12, with the PTF for APAR PH19242 applied, you can now use the DSN1COMP stand-alone utility to estimate the space savings that you might realize by compressing your data in Db2 for z/OS table spaces with IBM z14 hardware-based Huffman compression.  The capability to compress data with Huffman compression was introduced in function level 504, but you can now use the new DSN1COMP capability in any function level in Db2 12.

This APAR introduces a new optional COMPTYPE  parameter for the DSN1COMP stand-alone utility. You can specify ALL, FIXED, or HUFFMAN. It also introduces a more readable format for the DSN1COMP utility output for table spaces. If you specify COMPTYPE(ALL) or COMPTYPE(HUFFMAN), the resulting DSN1COMP utility report, in message DSN1940I, now includes estimates for the effectiveness of compression using Huffman encoding. If you run DSN1COMP with COMPTYPE(ALL) on IBM z14 or newer hardware, which is the default value, the the DSN1COMP report includes both the fixed-length and Huffman estimates.

For example, assume assume that you run the DSN1COMP utility on IBM z14 hardware with either of the following control statements:


The following example shows the format of the output:

DSN1999I START OF DSN1COMP FOR JOB DSN1COMP COMPTS3                                                                                 
  DSN1998I INPUT DSNAME = UNI2SA9H.DSNDBD.IWMUNCMP.TS056.I0001.A001   , VSAM                                                          
  DSN1944I DSN1COMP INPUT PARAMETERS                                                                                                  
             4,096  DICTIONARY SIZE USED                                                                                              
                 0  FREEPAGE VALUE USED                                                                                               
                 5  PCTFREE VALUE USED                                                                                                
                    COMPTYPE(ALL) REQUESTED                                                                                           
                    NO ROWLIMIT WAS REQUESTED                                                                                         
                    ESTIMATE BASED ON DB2 REORG METHOD                                                                                
               255  MAXROWS VALUE USED                                                                                                
  DSN1940I DSN1COMP COMPRESSION REPORT                                                                                                
    HARDWARE SUPPORT FOR HUFFMAN COMPRESSION IS AVAILABLE                                                                             
    |                                   | UNCOMPRESSED     | COMPRESSED       | COMPRESSED       |                                    
    |                                   |                  | FIXED            | HUFFMAN          |                                    
    | DATA (IN KB)                      |        1,723,378 |          435,851 |          358,871 |                                    
    | PERCENT SAVINGS                   |                  |               74%|               79%|                                    
    |                                   |                  |                  |                  |                                    
    | AVERAGE BYTES PER ROW             |            2,761 |              700 |              577 |                                    
    | PERCENT SAVINGS                   |                  |               74%|               79%|                                    
    |                                   |                  |                  |                  |                                    
    | DATA PAGES NEEDED                 |          639,630 |          127,942 |          106,625 |                                    
    | PERCENT DATA PAGES SAVED          |                  |               79%|               83%|                                    
    |                                   |                  |                  |                  |                                    
    | DICTIONARY PAGES REQUIRED         |                0 |               16 |               20 |                                    
    | ROWS SCANNED TO BUILD DICTIONARY  |                  |               67 |               67 |                                    
    | ROWS SCANNED TO PROVIDE ESTIMATE  |                  |          639,630 |          639,630 |                                    
    | DICTIONARY ENTRIES                |                  |            4,096 |            4,080 |                                    
    |                                   |                  |                  |                  |                                    
    | TOTAL PAGES (DICTIONARY + DATA)   |          639,630 |          127,958 |          106,645 |                                    
    | PERCENT SAVINGS                   |                  |               79%|               83%|                                    

 However, if you prefer to see estimates for fixed-length compression only, you can specify COMPTYPE(FIXED). 

Even if you are running on IBM z13 or earlier hardware, you can also specify COMPTYPE(ALL) or COMPTYPE(HUFFMAN) when you run DSN1COMP to see the expected result of compressing your data with Huffman encoding after you migrate to IBM z14 or newer hardware.

However,  if you omit COMPTYPE  when you run the DSN1COMP utility on IBM z13 or earlier hardware, the COMPTYPE(FIXED) is the default, and the report includes only the fixed-length compression estimates.

It’s also worth noting that this new DSN1COMP enhancement works only for non-compressed data. If you are among the majority of Db2 clients who already use data compression extensively today, you would still have to decompress your data to be able to use DSN1COMP to determine whether Huffman is the right option for you. That said, we have a number of other improvements regarding Huffman compression planned, and we will cover those in future blog entries in due course.

Paul McWilliams is an Information Developer for Db2 for z/OS.

Sign in and subscribe to always get the latest news about Db2 for z/OS from the IBM lab: http://ibm.biz/db2znews-subscribe