User`s guide

The program passes this merged record (A+B) back to the Report Designer, which tests the
record against the entire selection formula.
The program then reads the second matching record and passes the merged record on, and
then reads the third matching record, and so on, until it has read all of the matching records.
The program then returns to Table A and reads the next record. There is no need to test the
record to see if it meets the CA condition; the field is indexed and the records are in alphabetic
order. But the program tests the record to see if it goes beyond the "IL" condition (for example,
could the next record be from Mississippi or Tennessee?). If the record is still within the specified
range, the program begins the matching process again for that record.
The program continues the process until it has located all targeted Table A records and the
matching Table B records.
To find two records in Table A and the 100 records in Table B that match the Table A records,
the program reads 200 records.
If there is no index on Table A, or if there is an index but the range limit selection condition is not
based on the indexed field, the program reads the first record it finds.
For that record, the program uses the Table B index to locate the first matching record in Table
B.
The program passes this merged record (A+B) back to the Report Engine, which tests it against
the entire selection formula.
The program then locates the second matching record in Table B and passes that merged record
back, then the third record, and so on, until it has located, merged, and passed back all the
records in Table B that match the first record in Table A.
The program then moves on to the next record in Table A and begins the matching and merging
process all over again.
To find two records in Table A and the 100 records in Table B that match the Table A records,
the program reads 2600 records.
23.5.4.2 Subreports and data files
If your primary report is based on Table A, the subreport is based on Table B, and the records are
linked, your primary considerations are as follows:
The number of subreports that are run by the program is determined by the index and the selection
formula situation in the primary report:
If Table A is indexed, and if the primary report has a selection formula that passes down range
limit conditions for the indexed field, the program runs two subreports.
If Table A is not indexed, or if Table A is indexed but the selection formula does not pass down
range limit conditions for the indexed field, the program runs 26 subreports.
2012-03-14525
Understanding Databases