The REBUILD.ALL.INDICES command rebuilds the alternate key index on all files in the account.
The REBUILD.ALL.INDICES command scans the vocabulary file of the account in which it is executed and identifies all of the F-type items that reference files that have alternate key indices. These indices are then rebuilt. If a file is referenced by more than one VOC entry, the indices are only built once.
Except when executed in the QMSYS account, the command ignores files in the QMSYS account (e.g. system files).
Under normal circumstances, it should not be necessary to rebuild indices as they should be correctly maintained in step with updates applied to the associated data files. REBUILD.ALL.INDICES may be useful after restoring a backup for which indices were omitted or to ensure system integrity after a power failure.
Except when used with the CONCURRENT keyword, the REBUILD.ALL.INDICES command requires exclusive access to each file that it processes. It is therefore best executed at quiet times.
The CONCURRENT keyword allows indices to be built while the files are in use. There is a small performance overhead for this and the QMBasic SELECTINDEX, SELECTLEFT and SELECTRIGHT statements may stall waiting for the build to complete.