Hitachi

Hitachi Advanced Database Command Reference


16.1.3 Optional functions of the adbidxrebuild command

The adbidxrebuild command provides the following optional functions:

Organization of this subsection

(1) Re-execute facility

When the adbidxrebuild command is re-executed after having terminated abnormally, it resumes the index rebuild processing from the location where the index contents are guaranteed from the previous session of index rebuild processing. This reduces the amount of time required for re-execution of index rebuild processing.

Use of the re-execute facility is appropriate when the following conditions are satisfied:

In the following cases, even if the above conditions are satisfied, the re-execute facility is not applied (index rebuild processing is forcibly re-executed from the beginning):

The conditions under which the re-execute facility is applied and the processing that is performed during command re-execution depend on whether CHUNK was specified in the definition of the target table, which contains the indexes to be rebuilt. That is, the conditions and processing depend on whether the target table is a single-chunk table or multi-chunk table.

If the target table is a single-chunk table

In index rebuild processing, table data is retrieved and range indexes are rebuilt first, and then B-tree and text indexes are rebuilt.

If the adbidxrebuild command is re-executed after retrieval of the table's data has been completed (and the KFAA80233-I message has been issued, indicating that retrieval of the table's data has been completed), the re-execute facility is applied and index rebuild processing restarts with rebuilding of B-tree and text indexes

Figure 16‒4: Overview of the re-execute facility for a single-chunk table

[Figure]

Note that the re-execute facility is not applied in the following cases:

  • Only range indexes have been rebuilt.

  • The adbidxrebuild command was canceled while table data was being retrieved (before the KFAA80233-I message was issued).

  • The adbidxrebuild command was executed with the --create-temp-file option specified.

If the target table is a multi-chunk table

If the target table is a multi-chunk table, the index rebuild processing is performed for each chunk.

Therefore, if the adbidxrebuild command is re-executed after processing on a multi-chunk table stops, the re-execute facility is applied. Thus, the index rebuild processing restarts with the chunk for which processing was underway when the previous command's execution was canceled.

Note that if the adbidxrebuild command was stopped while it was retrieving table data from the first chunk (before the first instance of the KFAA80233-I was issued), the re-execute facility is not applied.

Figure 16‒5: Overview of the re-execute facility for a multi-chunk table

[Figure]

If the following three conditions are satisfied, index rebuild processing restarts from the point of rebuilding B-tree and text indexes in the chunk where the previous processing was canceled:

  • The indexes to be rebuilt include B-tree or text indexes.

  • All table data has been retrieved from the chunk where the previous processing was canceled (when retrieval of table data from a chunk is completed, the KFAA80233-I message is issued).

  • The adbidxrebuild command was executed without the --create-temp-file option specified (if the adbidxrebuild command was executed with the --create-temp-file option specified, index rebuild processing restarts from the point of retrieving table data in the chunk where the previous processing was canceled).

Figure 16‒6: Restarting from rebuilding of B-tree and text indexes in the chunk where the previous processing was canceled

[Figure]

(2) Inheriting index creation processing from the adbimport command

The adbidxrebuild command can inherit index creation processing from the adbimport command.

If you execute the adbidxrebuild command because the adbimport command could not be executed for any of the following reasons, the adbidxrebuild command inherits index creation processing:#

#

If an index for the table to be processed is deleted by using the DROP INDEX statement before the adbidxrebuild command is executed, the deleted index will not be rebuilt. In addition, if all indexes being created are deleted before the adbidxrebuild command is executed, only command termination processing is performed.

Processing by the adbidxrebuild command differs depending on the option specified for it.

■ If the adbidxrebuild command is executed with the --create-temp-file option specified

If you execute the adbidxrebuild command with the --create-temp-file option specified, the adbidxrebuild command starts with retrieval of table data for which a temporary work file is to be created.

Figure 16‒7: Inheriting index creation processing from the adbimport command (with the --create-temp-file option specified)

[Figure]

If the table to be processed is a multi-chunk table, the chunk that was being processed when the adbimport command was stopped becomes the processing target of the adbidxrebuild command. The target chunk is not changed until the adbidxrebuild command terminates normally.

■ If the adbidxrebuild command is executed with the --force option specified

If you execute the adbidxrebuild command with the --force option specified, the adbidxrebuild command starts with the beginning of index rebuild processing.

Figure 16‒8: Inheriting index creation processing from the adbimport command (with the --force option specified)

[Figure]