Defining Descriptors

#### Search Results

Search

# Defining Descriptors

This document covers the following topic:

- ADAINV Processing Considerations

## ADAINV Processing Considerations

- Establishing a New Descriptor

- Releasing a Descriptor

- Checking the Integrity of Inverted Lists

- Rejected Data Records

### Establishing a New Descriptor

Defining a new descriptor leads to modifications in the Field Definition Table (FDT) and results in the creation of an inverted list. New Main Index and Normal Index blocks are required to store the inverted list entries for the new descriptor. ADAINV allows any number of descriptors to be established within the same run.

ADAINV builds the new Normal Index and Main Index on a descriptor by descriptor basis. During this pass, the linking entries are still missing in the Upper Index and none of the new inverted lists can, therefore, be accessed. When the Normal Index and Main Index of all the new descriptors have been built, the FDT is updated and corresponding entries are added to the Upper Index.

#### Loading of Normal Index and Main Index

All of the data records in the file have to be read in order to build the new Normal Index and Main Index. Within each record, the field associated with the new descriptor is used to generate a descriptor value and it's ISN. These values are sorted according to ascending descriptor values and ISNs. The output of the sort is used to build the new Normal Index and Main Index. Descriptors defined with the unique option are checked to ensure that the Normal Index contains only one ISN per descriptor value. If more than one ISN is found, the conflicting ISNs are written to the error log, the unique flag is reset within the FDT and processing continues if UQ_CONFLICT is set to RESET. If UQ_CONFLICT is set to ABORT or is omitted, ADAINV aborts.

Besides sorting the descriptor values, reading the data records is very time-consuming because of the numerous I/Os. Therefore, if a large number of descriptors are to be established in one run, ADAINV tries to minimize the number of passes required to read through the data storage. In the first pass through the data storage, the values for one descriptor are directly passed to the sort. The values of two additional descriptors, if they exist, are written to the TEMP data set, and all other values of the remaining descriptors, their total sizes and quantities are accumulated. This accumulation of data optimizes the remaining passes through the data storage. The greater the number of descriptors using the TEMP in parallel during each pass, the faster the inversion will be. ADAINV displays the total number of passes required at the end of the run.

All index blocks are filled in accordance with the padding factor specified when the file was loaded. New index blocks are taken from the existing extents as required. When these blocks are exhausted, an automatic extension is carried out in accordance with the rules described for the mass update utility ADAMUP.

Processing continues as described above if the extension is successful, otherwise ADAINV terminates with an error message.

#### Updating the Upper Index

Whereas the Normal Index and Main Index are organized on a descriptor by descriptor basis, the Upper Index, index level 3 and higher, contains all descriptors. In order to link in the new Main Index, an entry must be made in the Upper Index for each new Main Index block. The new entries can be added in two ways:

- If the updates only affect level 3 blocks, the new entries are inserted directly into the existing Upper Index.

- If block splitting or updates in levels higher than 3 become necessary, the whole Upper Index is rebuilt. The padding factor specified when loading the file is reestablished. All old index blocks and pre-allocated blocks are used before additional blocks are allocated. If additional blocks are required, the procedure described for Normal Index and Main Index loading is used.

### Releasing a Descriptor

Releasing a descriptor leads to modifications in the Field Definition Table (FDT) and results in the elimination of an access path. All Main Index and Normal Index blocks that contain the inverted list entries for the descriptor are released, but cannot be reused. Any number of descriptors may be released in one run.

#### Updating the Upper Index

When a descriptor is released, corresponding entries have to be removed from the Upper Index. These entries can be removed in two ways:

- If the updates only affect level 3 blocks, the new entries are deleted directly from the existing Upper Index.

- If blocks become empty or updates in levels higher than 3 are necessary, the whole Upper Index is rebuilt. The padding factor specified when loading the file is re-established. All old index blocks and pre-allocated blocks are used before additional blocks are allocated. If additional blocks are required, the procedure described for Normal Index and Main Index loading is used.

#### Releasing Main Index and Normal Index

In principle, a descriptor can be released just by removing the corresponding entries from FDT and Upper Index. Disabling the link to the index level below virtually deletes the Main Index and Normal Index. Although not mandatory, ADAINV physically clears all Normal Index and Main Index blocks of the old descriptor. The resultant overhead is compensated for by data security and improved performance of the backup utility ADABCK, since empty blocks are not dumped.

### Checking the Integrity of Inverted Lists

Inverted lists are maintained by Adabas for each elementary, sub-, super-, hyper- and phonetic descriptor defined within a file. In order to guarantee their integrity, it must be ensured that

- each ISN in the inverted list is associated with an existing data record and that this data record is the correct one;

- each record in the data storage is represented in the inverted list by its ISN and the descriptor value entries generated.

When verifying a descriptor, ADAINV simulates loading of the normal index and matches the output from the sort against the content of the inverted list. This checks both of the points mentioned above in one run and detects uniqueness conflicts. All inconsistencies found will be reported. The file remains unchanged.

### Rejected Data Records

Any records rejected by ADAINV are written to the ADAINV error file. The contents of this error file should be displayed using the ADAERR utility. Do not print the error file using the standard operating system print utilities, since the records contain unprintable characters.

Please refer to the ADAERR utility in the Adabas Utilities Manual for further information.