VERIFY-INDEX

Verifies an index with respect to its index or dictionary definition.

Command Class

TCL-I command.

Syntax

VERIFY-INDEX file-name{,data-section} index-definition {(options}

Syntax elements

file-name The name of the file containing the index to be verified.

data-section The name of the data section with which the index is associated. Must immediately follow file-name and be preceded by a comma. If omitted, the default data section is assumed.

index-definition The name of the index or dictionary definition item from which the index was created.

Options

D Just verify the internal definition against that used to create the index

V Verbose - list item-ids and keys that fail any checks.

Operation

VERIFY-INDEX performs two passes:

  1. Sequentially read through the index, and for each key read the relevant item. Then generate a new key from the item contents and compare the key read with the key generated.

  2. Sequentially read through the data section and generate keys for each item. Then set position on the generated key(s) to make sure they exist.

VERIFY-INDEX displays a report in the following format:

n keys.      n missing items.     n mismatches.     n invalid keys.
n items.     n keys.              n missing keys.

The first line is reported after pass 1:

n keys. The number of keys in the index.

n missing items. The number of keys that did not have a corresponding item.

n mismatches. The number of keys, where the corresponding item generated a different key.

n invalid keys. The number of corrupt keys within the index.

The second line is reported by pass 2:

n items. The number of items in the file

n keys. The number of keys generated by the above items (for non-exploding indexes this is always the same as the number of items).

n missing keys. The number of items that did not have a corresponding key within the index.

It is possible for an item to be updated concurrently with the check on the item. It is therefore possible, on a very busy system, for a very small number of keys to mismatch. If the file was quiescent when the verification was done, any key mismatches or non-existent item references should be corrected by recreating the index using DELETE-INDEX followed by CREATE-INDEX.

There is no provision for 'correction' of the index, since the entire index is derivative data.

Case sensitivity

For correct operation, an index relies on always using the same settings for data and item-id case-sensitivity. Because of this, when you create an index, the current settings for these are saved with that index.

If you subsequently change the item-id case-sensitivity of the file with the CONVERT-FILE command, you will invalidate the index. For such an index, VERIFY-INDEX will fail with the error message:

[1313] File & Index IID sensitivities do not match!

To restore correct operation, you must recreate the index using DELETE-INDEX followed by CREATE-INDEX.

Examples

:VERIFY-INDEX SALESTAFF GT200
9 keys. 0 missing items. 0 mismatches. 0 invalid keys.
5 items. 9 keys. 0 missing keys.
:VERIFY-INDEX EXP I1 (V
No item 'K' for key '.B'
9 keys. 1 missing items. 0 mismatches. 0 invalid keys.
4 items. 8 keys. 0 missing keys.

In the second example an index key 'B' existed that referred to item 'K'. Item 'K' did not exist in the data section.

:VERIFY-INDEX EXP S
Definition of Implicit index, BY-DSND S , verifies.
   5 keys.      0 missing items.     0 mismatches.     0 invalid keys.
   5 items.     5 keys.              0 missing keys.
[1296] The index specified verifies.

In the third example, the index was created from a data definition item in the dictionary.

:VERIFY-INDEX EXP X (D
Definition of Implicit index, BY X (U, verifies.

In the fourth example, the D option specifies that the internal definition should be verified against that used to create the index.

See also

Indexing, DEFINE-INDEX, CREATE-INDEX, DELETE-INDEX.