Previous Topic: Using &NDBSCAN Statements

Next Topic: Display the Generated Scan Action Table

Scan Processing

Note: For more information about the steps taken to process an &NDBSCAN statement, see the &NDBSCAN verb description in the Network Control Language Reference Guide.

A scan has the following processing steps:

  1. The scan request is parsed, and an action table built. The action table is then optimized.
  2. The action table is processed and, for each action that can be processed using keys, the key records in the database are used to build intermediate results.
  3. If part of the request could not be processed using keys, the final result list (from Step 2) is processed by reading records, and each record is validated against the scan criteria.

    If none of the criteria could be processed using keys, the entire database is scanned.

  4. If a sort was requested, the sort keys are extracted from passing records, and an internal sort is performed.

    The final result list is built. Sorting is done during Step 3 or 4 as part of its processing.

These steps seem complex, but no knowledge of the internal processing is necessary to use &NDBSCAN. However, when performance is an issue, use of keyed fields becomes important.