WHERE clause in find statement

I have a program using a FIND statement with the WHERE clause.

Does WHERE clause increase the ADABAS call limits?
What is most efficient way to get the records from the ADABAS?

If you have questions on ADABAS performance, then I suggest you post to one of the ADABAS forums. If you have questions on how to use Natural, please review the list of forums for one more appropriate to your question than “News”.

WHERE clause does not increase the ADABAS call limits.

The answer to the second question is “it depends”. What are your selection criteria? How large a portion of the file do you need? Are the selection criteria fields indexed (descriptors)? Do you need the records ordered?

In general, a FIND works best to select a small subset of the file (typically 20% of the records or less). Ideally, there is a single descriptor (descriptor, super-descriptor, sub-descriptor) that selects most of the subset you are interested in and, if further refinement is needed, the WHERE clause is used to accept/reject records as they are returned from ADABAS. The guideline is: WITH gets the smallest set possible; WHERE gets the largest set possible out of that smaller set.

Additional descriptors can be used in the WITH clause to narrow down the set returned from ADABAS, but “it depends” becomes a bigger factor as you add criteria to the WITH - it depends on the distribution of values, the size of the file, etc to estimate “most efficient”.

If you need to return a larger, ordered subset of records from ADABAS, READ LOGICAL (reads records sequentially from a starting value by a single descriptor) frequently becomes the most efficient. If order is not important or you need to read most of the file, the READ PHYSICAL is often most efficient.