Previous Topic: Index Design RecommendationsNext Topic: Index Free Space


Index Compression

In DB2 9, an index can be defined with the COMPRESS YES option; COMPRESS NO is the default. Index compression can be used when you have to reduce the amount of disk space that an index consumes. We recommend index compression for applications that do sequential insert operations with few, or no, delete operations. Random inserts and deletes can adversely affect compression. We also recommend index compression for applications where the indexes are created primarily for scan operations.

A buffer pool that is used to create the index must be 8 KB, 16 KB, or 32 KB. The physical page size for the index on the disk will be 4 KB. The buffer pool size is larger than the page size because index compression saves space only on the disk. The data in the index page is expanded when read into the pool. So, index compression can possibly save you read time for sequential, and random operations (but far less likely).

Index compression can have a significant impact on the REORGs and index rebuilds, resulting in significant savings in this area; however, if you use the copy utility to back up an index, that image copy is uncompressed.