Reorganizing indexes

A schema change that affects an index might cause performance degradation. In this case, you might need to reorganize indexes to correct any performance degradation.

About this task

Although data availability is maximized by the use of index versions, performance might suffer because Db2 does not automatically reformat the data in the index to conform to the most recent schema definition. Db2 defers any reformatting of existing data until you reorganize the index and apply the schema changes. The more ALTER statements (which affect indexes) that you commit between reorganizations, the more index versions Db2 must track, and the more performance can suffer.

Procedure

To reorganize an index:

Run the REORG INDEX utility as soon as possible after a schema change that affects an index.
You can also run the REORG TABLESPACE utility.