User guide

5 Using ENFORM Efficiently
058058 Tandem Computers Incorporated 5–1
After you develop a successful ENFORM query, consider optimizing the efficiency of
the query. This section provides information about using the ENFORM statistics to
examine the efficiency of your query and about changes that you can make to improve
query performance.
Using ENFORM Search
Statistics
When you set the Option Variable @STATS to ON, ENFORM produces search
statistics. An understanding of these statistics is useful when you are attempting to
improve the performance of your ENFORM queries.
Figure 5-1 shows a sample query and the resulting statistics. The following
paragraphs explain these statistics.
Figure 5-1. Simple ENFORM Query and Associated Search Statistics
SET @STATS TO ON;
OPEN parts,odetail,order;
LINK parts TO odetail VIA partnum;
LINK order TO odetail VIA ordernum;
LIST BY partname,BY order.ordernum,quantity;
FILE NAME LEVEL READ RECORDS READ POSITIONS
$MKT.SAMPLE.parts 3 3 3
$MKT.SAMPLE.order 2 3 127
$MKT.SAMPLE.odetail 1 127 1
003,08,052 BEGIN(8/16/82 - 09:03:02:41) END(8/16/82 - 09:03:14:78)
STRATEGY COST = 2
The FILE NAME Column The first column, headed FILE NAME, provides the names of the different physical
files that the query processor reads to obtain the retrieved data. In Figure 5-1, the
query processor read the physical files named $mkt.sample.parts, $mkt.sample.order, and
$mkt.sample.odetail.
The LEVEL READ Column The second column, headed LEVEL READ, provides a number that identifies the
sequence in which the query processor read the physical files. The first file read has a
value of 1, the second file read has a value of 2, and so on. In Figure 5-1, the first
physical file read is $mkt.sample.odetail, the second physical file read is
$mkt.sample.order, and the third physical file read is $mkt.sample.parts.