Performance READ + FIND NUMBER vs. READ + IF ARRAY(*)

I also thought about the buffer pool. So my test code above reads the first 1.000.000 records of file_a and takes e.g. 500 records from it for searching. The records to search are equally distributed.
And after that I do the first test. It’s not provable - but I think some (or even all) of the file_a records are in the bufferpool before the first test starts.

I do not expect multiple records in my scenario.

For the sequential READ, I would use the MULTI-FETCH clause.
I think also that the sequential match is here the best approach.

Lots of good suggestions here. From my perspective and experience:

  1. The outside loop will consume most of the time if you eliminate the FIND NUMBER.
  2. Doing a READ to load into an array is a great idea I do it all the time. Note I also use this technique for table lookups online using +AIV-arrays.
  3. If you are reading lots of records for lookup use MULTIFETCH.
  4. Try setting array size to max at beginning and only expand when you get to max instead of each time.
  5. In many real life situations there are related fields (arrays) so Examine giving occurrence is very valuable to obtain the related data items.
    My 5 cents.

BTW. w.r.t. MultiFETCH you can use it on the outside FIND as well !!!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.