C
ChUIMonster
Guest
Can you replace that code with: for each customer no-lock: find address no-lock where address.addresskey = customer.addresskey. end. If you can do that -- does it perform better? If you get a runtime error on the FIND because the WHERE is not unique then that is why your ratio is off. Baically if you have an index on the address table whose leading component is "addresskey" and which if address key is unique then you do not need the FIRST and the query will be as efficient as possible. If you do not have such an index then you have to do extra work to find the FIRST record. (And that FIRST record is also denormalized black magic which will probably cause a bug some day.)
Continue reading...
Continue reading...