Item-ID considerations

Another decision facing the designer is the makeup of the item-ID.

Here are a few guidelines for choosing an item-ID:

AQL delimiters in a file is not permitted.

The rest (system delimiters, control characters, spaces) can be accepted as characters in your item-IDs but are not advisable.

It is permitted to use the following characters within item-IDs:! # $ % & + - . / : ? @ _

For example, BOB.SMITH, BOB-SMITH, BOB_SMITH, and BOB/SMITH are all valid (and different) item-IDs. Also, keep in mind that the file may be case sensitive.

Each item-ID in a file must be unique.

Choose item-IDs that hash well.

Hashing describes how items are distributed among the groups in the file. An ideal situation would be that every group holds an equal number of items. In reality, the distribution of items may not be so even. D3 handles these inconsistencies well, so the system performance degradation they cause is negligible. The actual hashing scheme is described elsewhere, but because of the way the algorithm works, the right characters of the item-ID have the greatest influence on the group to which an item is assigned. This means that sequential alphabetic or numeric item-IDs hash better. Item-IDs should not be assigned in even multiples (411000, 412000, 413000, and so on) as this may cause an uneven distribution of the items in the groups. The istat command shows how items are placed within groups of existing files.

Limit the size of the item-ID to as few bytes as possible.

Choose item-IDs that sort well if the items are sorted by the item-ID often.

If the item-ID is strictly alphabetic or strictly numeric, the results are straightforward. But if the item-ID is partially alphabetic and partially numeric, a sorted list shows the following item-IDs in this order: w2, w3, w399, w4, and w401.

To sort the item-IDs numerically, (for example, w2, w3, w399, w4, and w401) a FlashBASIC program called from the file-defining item correlative is needed to create an index, or use a synonym attribute-defining item with right alignment for attribute zero.

As a reminder, D3 can use the ID correlative code in the file-defining item to automatically assign sequential item-IDs.