Implementing Search Limits

The RECORDLIMIT phrase sets a maximum for the number of rows the data adapter fetches from the answer set returned by the RDBMS. It does not restrict the RDBMS in its construction of the answer set. However, if the RDBMS does not have to sort the answer set, using this feature may result in a significant reduction in response time.

How to:

Implement Search Limits

Example:

Using Oracle READLIMIT Optimization

The READLIMIT phrase is synonymous with RECORDLIMIT except in the following cases:

The READLIMIT and RECORDLIMIT phrases are effective in reducing RDBMS-to-FOCUS communication traffic, the volume of formatted report data, and terminal and disk I/Os.

Search limit tests are helpful when:

In all three cases, a few rows are sufficient to verify results.


Top of page

Syntax: How to Implement Search Limits

{WHERE|IF} {RECORDLIMIT|READLIMIT} {EQ|IS} n

where:

n
Is the number of records to be included in the TABLE request.

The FOCUS database administrator may place the READLIMIT or RECORDLIMIT test in a Master File to limit the fetching of rows for all users. If the Master File and the report request both contain such a test, the data adapter uses the lower of the two values.

Note:


Top of page

Example: Using Oracle READLIMIT Optimization

Assume the EMPLOYEE Master File describes the Oracle table USER1.PAYROLL and consider the following request:

TABLE FILE EMPLOYEE
PRINT EMP_ID
WHERE READLIMIT EQ 5
END

The Oracle Data Adapter generates the following SQL for this request:

SELECT T1.EMP_ID FROM "USER1"."PAYROLL" T1 WHERE ROWNUM <=5 ;

Because the screening condition is passed to the RDBMS, only the first five rows retrieved by Oracle are returned. This results in less communication between the RDBMS and FOCUS and less processing by FOCUS prior to displaying the report output.


Information Builders