(Contents)(Next)

The FASTLOAD Statement

LOAD usually creates a series of INSERT statements from a DATALOAD statement and executes them in groups in a sequence of transactions. The inserted table rows are additionally written into the database log whereas rejected records are written into the LOAD protocol file. The affected tables are available for other users even during the load run and can be read and modified afterwards.

The FASTLOAD statement achieves faster loading times, but dispenses with much of the comfort provided by the normal DATALOAD function.

The FASTLOAD statement is meant for cases where the data to be loaded is assumed to be correct and a backup copy of the database is created after loading (see ADABAS CONTROL manual: SAVE PAGES or SAVE DATA).

As no database log is written with FASTLOAD, this statement is particularly suited for cases in which otherwise, loading a very large data file would require a log DEVSPACE beyond the requirements of normal database operation.

Loading with FASTLOAD instead of DATALOAD does not restrict normal database operation; every user can load his tables independently of other users without logging.

There is, however, a considerable difference with regard to the input data: if the table contains KEY columns, only those rows may be inserted which, in ascending order, can be included after the already existing rows.

The table is write-protected after having been accessed with FASTLOAD. Nevertheless it may be loaded with data from other files in further FASTLOAD runs.

The FASTLOAD statement has the same structure as a DATALOAD statement and provides the same options:

Example:

FASTLOAD

TABLE PUBLIC.germ_eng

german 01-20

english_1 21-40

english_2 41-60

english_3 61-80

INFILE germeng.data

FASTLOAD, however, imposes the following restrictions:

- FASTLOAD may only be used by the owner of the table.

- Only one FASTLOAD statement is allowed per INFILE, which means that it is not possible to load several tables simultaneously in one run.

- If the table contains KEY columns, the input data must be sorted in ascending order according to its key values.

- No index may exist for the table.

- The table must not contain LONG columns.

- The table must be assigned to the current SERVERDB.

- While loading the table, it is continuously locked against reading and writing by other users.

- The inserted table rows are not written into the database log.

- The table is locked against all write operations, except FASTLOAD until the next backup of the database (SAVE PAGES or SAVE DATA); however, it may be read.

- If the table cannot be loaded successfully, all entries made during this load run are deleted again. The data previously inserted is preserved.

- If the database must be RESTARTed before the table has been backed up, the rows inserted with FASTLOAD will not be there any more.

FASTLOAD runs are executed outside the database's transaction concept. During interactive execution, LOAD uses a clock to show the counter readings - independent of the defined transaction size.

If a user cancels a load run (see chapter RUN with STOP Option), the LOAD protocol file shows the record of the file after which the run was terminated.


(Contents)(Next)