Nonstop Database, HiRDB Version 9 System Operation Guide

[Contents][Index][Back][Next]

14.1.1 Overview of index reorganization

When data is deleted (DELETE) or updated (UPDATE) repeatedly, index storage efficiency deteriorates, reducing the efficiency of index-based retrievals. Any of the following measures can be taken with the database reorganization utility to prevent this:

This section explains index reorganization, which is the best measure in terms of performance. The following figure provides an overview of index reorganization processing.

Figure 14-1 Overview of index reorganization processing

[Figure]

Explanation
An index information file is created by retrieving index key information, and the index is rearranged based on this information. This is called index reorganization. Index reorganization can be executed by index or by index RDAREA.
Organization of this subsection
(1) Application standard
(2) When to use index reorganization and when to use table reorganization
(3) Difference from index re-creation
(4) Notes on index reorganization
(5) Reducing the reorganization execution time
(6) Reorganizing an index in an RDAREA that has insufficient free space

(1) Application standard

Index reorganization is used for freeing the unusable areas in index storage pages that have resulted from addition, deletion, or updating of a large volume of data.

(2) When to use index reorganization and when to use table reorganization

(3) Difference from index re-creation

In index re-creation, the table's data is retrieved. In contrast, the table's data is not retrieved in index reorganization. For this reason, index reorganization requires less processing time than re-creation,# sorting is not required, and processing performance is improved. However, since plug-in indexes cannot be reorganized, you must re-create them.

#: Processing time is reduced when the following condition is satisfied:
number-of-used-pages-in-RDAREAs-storing-table > number-of-used-pages-in-RDAREAs-storing-index

(4) Notes on index reorganization

(5) Reducing the reorganization execution time

If no database update log is being collected during index reorganization (no-log mode or pre-update log acquisition mode is in effect), there is a commensurate reduction in processing time. Collection of a database update log is specified with the -l option of the pdrorg command. The default is the pre-update log acquisition mode.

(6) Reorganizing an index in an RDAREA that has insufficient free space

When an index is reorganized, a percentage of unused area per page can be specified in the PCTFREE operand of CREATE TABLE or CREATE INDEX. However, if the index being reorganized is in an RDAREA that has insufficient free space to accommodate the specified percentage of unused area, the RDAREA can run out of space during index reorganization processing. To prevent this, you should specify the idxfree operand in the option statement of the database reorganization utility (pdrorg), and use the PCTFREE operand of CREATE TABLE or CREATE INDEX to change the percentage of unused area per page.

Note that this is a temporary measure that is used when the RDAREA cannot be immediately expanded before index reorganization. In preparation for data updating, you should use the database structure modification utility (pdmod command) to expand the RDAREA so that reorganization can be performed that is within the value specified in the PCTFREE operand of CREATE TABLE.