6.1.8 Data loads that use the automatic numbering facility

Use the sequence generator identifier to number automatically. This is called the automatic numbering facility. When data is loaded, sequence numbers generated by the sequence generator identifier can be stored in the table columns. This section describes selection criteria for the acquisition methods and storage methods of sequence numbering.

For details about the automatic numbering facility, see the HiRDB Version 9 UAP Development Guide; for details about loading data using the automatic numbering facility, see the manual HiRDB Version 9 Command Reference.

Organization of this subsection
(1) Criteria for selecting sequence number acquisition method
(2) Criteria for selecting a sequence number storage method

(1) Criteria for selecting sequence number acquisition method

There are three methods for acquiring sequence numbers.

Number batch acquisition method:
After data has loaded, uses the sequence generator identifier values to number the sequence as a batch.
Specification unit acquisition method:
Loads data while acquiring sequence numbers at every specified unit.
Buffer unit acquisition method:
Loads data while acquiring sequence numbers in batches equal to the number of lines that can be read into the input buffer.

When selecting a method of acquiring sequence numbers, consider the features listed in the following table.

Table 6-3 Features of sequence number acquisition methods

Item consideredFeatures
Number batch acquisition methodSpecification unit acquisition methodBuffer unit acquisition method
Missing numbers under normal circumstancesDoes not occur.Missing numbers occur if the number of lines of data loaded is not a multiple of the specified unit.Does not occur.#2
Large quantities of missing numbers during rollbacksDoes not occur.The current value is not recovered even if a rollback occurs, so large quantities of missing numbers occur.The current value is not recovered even if a rollback occurs, so large quantities of missing numbers occur.
Communication overhead when requesting numbering from sequence generator identifier #1Since there are only as many numbering requests as there are data load commits, the impact of numbering on performance is kept to a minimum.The impact on performance can be kept to a minimum by keeping the number of numbering requests down by using large acquisition units.The impact on performance can be kept to a minimum by keeping the number of numbering requests down by using a large input buffer. However, the unit acquired at one time is determined by the line length calculated from the input buffer size and the column definition size, so a long line requires ample memory in the input buffer.
Simultaneous execution with UAPs that use the same sequence generator identifierCannot execute simultaneously. The sequence generator identifier is locked during data loading.Can execute simultaneously.Can execute simultaneously.
Parallel execution of data loading in RDAREA unitsCannot execute simultaneously. The sequence generator identifier is locked during data loading.Can execute in parallel.Can execute in parallel.
#1
For HiRDB/Parallel Server, communications occur during acquisition of sequence numbers when the server whose database load utility reads input data is different from the server where the sequence generator identifier is defined. Consequently, frequent numbering requests result in increased communications, which adversely affects data loading performance.
#2
When the sequence number storage method is not total replacement of column data, missing numbers might be generated.

(2) Criteria for selecting a sequence number storage method

There are three methods for storing sequence numbers. The following describes the criteria to use when you select a method.

Total replacement of column data:
All column data in the input data file is replaced by sequence numbers for the corresponding columns that store sequence numbers. Select this method when you are assigning new numbers to all the corresponding column values.
Partial replacement of column data:
Only the column data in the input data file whose data matches specified replacement conditions is replaced by sequence numbers for the corresponding columns that store sequence numbers. Select this method when, for example, the input data file is in DAT or extended DAT format and when you are replacing only the NULL value portion with sequence numbers.
Column data addition:
If the input data file has no data corresponding to the column that stores the sequence numbers, sequence numbers are added as input data. Select this method when you are adding new columns to store numbers. This method cannot be specified when the input data file format is binary.