DB2 Version 9.7 for Linux, UNIX, and Windows

Multiple compression dictionaries (for replication source tables)

The COMPRESS YES and DATA CAPTURE CHANGES options on CREATE TABLE and ALTER TABLE statements enable row compression on tables that are source tables for replication. With these options, either through REORG or through LOAD REPLACE operations, a source table can have two dictionaries: an active data compression dictionary and a historical compression dictionary.

The historical compression dictionary is the previous version of the data compression dictionary. It is required whenever a log reader is delayed behind current activity due to a potential REORG or truncate operation. This allows the db2ReadLog API to decompress the row contents in log records, which were written prior to the most recent REORG or if a new(er) dictionary was created as a result of a RESETDICTIONARY on a REORG or LOAD.

Note: To have log readers return the data within log records in an uncompressed format, instead of a raw compressed format, you must set the iFilterOption parameter of the db2ReadLog API to DB2READLOG_FILTER_ON.

A table's historical compression dictionary is removed during REORG TABLE and during table truncate operations (LOAD REPLACE, IMPORT REPLACE, or TRUNCATE TABLE), but only if the DATA CAPTURE NONE option is specified for the table.

To get the total dictionary size, in bytes, use the ADMIN_GET_TAB_INFO_V97 table function or the REPORT option of the ADMIN_GET_TAB_COMPRESS_INFO table function. Refer to these table functions for details.