UNIQUECHECK


LOADPLUS always checks unique index keys in the input records for duplicate values. The UNIQUECHECK option determines the phase in which LOADPLUS checks for duplicate values and how to handle discarding duplicates.

UNIQUECHECK.png

The following table summarizes the action that LOADPLUS takes based on the value for the UNIQUECHECK option and the type of indexes that are participating in the load job:

UNIQUECHECK option

Unique index type

LOADPLUS action on the unique key violation

YES

Any

  • Detects duplicates in the PRELOAD phase
  • Discards incoming records that violate the unique key requirement
  • Places records in the discard data set (SYSDISC)

CLUSTER

Data-sorting

See the UNIQUECHECK YES option

Non-data-sorting

See the UNIQUECHECK NO option

NO

Any

  • Detects duplicates in the LOAD phase
  • Deletes duplicates from the loaded table space and participating indexes but does not place them in the discard data set (SYSDISC)

Restrictions

The following restrictions apply to the UNIQUECHECK option:

  • You must specify UNIQUECHECK NO when both of the following conditions exist:

    • You specify INDEX UPDATE.
    • You are running a two-phase load (PRELOAD CONTINUE).

    If you specify UNIQUECHECK YES or CLUSTER, LOADPLUS issues message BMC51419E and terminates.

  • LOADPLUS ignores this option when any of the following conditions exist:
    • You are running an SQLAPPLY load.

      Db2 checks for duplicates during the apply process.

    • LOADPLUS invokes DSNUTILB.

      The IBM Db2 LOAD utility checks for duplicates.

    • You are running a single-phase load (PRELOAD LOAD)

      In a single-phase load job, LOADPLUS always checks all participating unique indexes for duplicates in the combined phase.

YES

UNIQUECHECK YES (the default) tells LOADPLUS to check for duplicates in key values for all participating unique indexes during the PRELOAD phase. When you specify or default to UNIQUECHECK YES and LOADPLUS detects a unique key violation, LOADPLUS discards the incoming records that violate the unique key requirement and places them in the discard data set (SYSDISC).

CLUSTER

UNIQUECHECK CLUSTER tells LOADPLUS to check for duplicates in key values for only the data-sorting indexes during the PRELOAD phase and to check for duplicates in non-data-sorting indexes during the LOAD phase. Specifying this option eliminates the need to sort and check other participating indexes in the PRELOAD phase, and can reduce the elapsed time of your load job. When you specify UNIQUECHECK CLUSTER and LOADPLUS detects a unique key violation, the actions that LOADPLUS takes depend on the type of index.

Restriction

LOADPLUS changes the value of this option to UNIQUECHECK YES if you specify or default to ORDER NO.

NO

Specifying this option indicates that you do not want LOADPLUS to check key values during the PRELOAD phase. Using this option eliminates the need to sort and check the indexes in the PRELOAD phase, which can reduce the elapsed time of your load job. When you specify UNIQUECHECK NO and LOADPLUS detects a unique key violation, LOADPLUS deletes the duplicates from the loaded table space and participating indexes but does not place them in the discard data set (SYSDISC).

 

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*