DB2的compress壓縮前後對比 對於如下表類型字段: www.2cto.com Data type Column Column name schema Data type name Length Scale Nulls ------------------------------- --------- ------------------- PART_NUM SYSIBM CHARACTER 15 0 No CNTRY_CODE SYSIBM CHARACTER 3 0 No ISO_CURRNCY_CODE SYSIBM CHARACTER 3 0 No SAP_DISTRIBTN_CHNL_CODE SYSIBM CHARACTER 2 0 No PRICE_START_DATE SYSIBM DATE 4 0 No PRICE_END_DATE SYSIBM DATE 4 0 No SRP_PRICE SYSIBM DECIMAL 19 4 Yes SVP_LEVEL_A SYSIBM DECIMAL 19 4 Yes SVP_LEVEL_B SYSIBM DECIMAL 19 4 Yes SVP_LEVEL_C SYSIBM DECIMAL 19 4 Yes SVP_LEVEL_D SYSIBM DECIMAL 19 4 Yes SVP_LEVEL_E SYSIBM DECIMAL 19 4 Yes SVP_LEVEL_F SYSIBM DECIMAL 19 4 Yes SVP_LEVEL_G SYSIBM DECIMAL 19 4 Yes SVP_LEVEL_H SYSIBM DECIMAL 19 4 Yes SVP_LEVEL_I SYSIBM DECIMAL 19 4 Yes SVP_LEVEL_J SYSIBM DECIMAL 19 4 Yes SVP_LEVEL_ED SYSIBM DECIMAL 19 4 Yes SVP_LEVEL_GV SYSIBM DECIMAL 19 4 Yes SAP_EXTRCT_DATE SYSIBM TIMESTAMP 10 6 No ADD_BY_USER_NAME SYSIBM CHARACTER 12 0 No SAP_ODS_ADD_DATE SYSIBM TIMESTAMP 10 6 No MOD_BY_USER_NAME SYSIBM CHARACTER 12 0 No SAP_ODS_MOD_DATE SYSIBM TIMESTAMP 10 6 No 24 record(s) selected. select a.tabschema,a.tabname,decimal(b.pagesize*a.npages/1024/1024,20,5) tablesize from syscat.tables a left join syscat.tablespaces b on a.tbspaceid=b.tbspaceid where a.TABSCHEMA='WWPP2' and a.TABNAME='CNTRY_PRICE' and a.type='T' order by a.tbspace C:\Program Files (x86)\IBM\SQLLIB\BIN>db2 select a.tabschema,a.tabname,decimal(b.pagesize*a.npages/1024/1024,20,5) tablesize from syscat.tables a left join syscat.tablespaces b on a.tbspaceid=b.tbspaceid where a.TABSCHEMA='WWPP2' and a.TABNAME='CNTRY_PRICE' and a.type='T' order by a.tbspace TABSCHEMA TABNAME TABLESIZE -------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- ---------------------- WWPP2 CNTRY_PRICE 2562.00000 1 record(s) selected. C:\Program Files (x86)\IBM\SQLLIB\BIN>db2 select a.tabschema,a.tabname,decimal(b.pagesize*a.npages/1024/1024,20,5) tablesize from syscat.tables a left join syscat.tablespaces b on a.tbspaceid=b.tbspaceid where a.TABSCHEMA='WWPP2' and a.TABNAME='CNTRY_PRICE' and a.type='T' order by a.tbspace TABSCHEMA TABNAME TABLESIZE -------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- ---------------------- WWPP2 CNTRY_PRICE 1964.00000 1 record(s) selected.