>> 'SET ORDER TO TAG ordkey IN vitems' could significantly slow down SCAN FOR.
>
>Can you please explain why. I noticed that an order is also set in the data envinorment and that original programmer resets order to original order after updates.
>
>Should I change this or just not reset the order? I assumed reseting order to key field would speed SCAN up, is this incorrect?
>
The SCAN FOR w/o order set on table would be faster because VFP can use index on 'vitems.clordno' to Rushmore optimize FOR condition. If order is set it could make it impossible for VFP to use Rushmore optimization. It's the best to not set any order and let VFP decide what index to use. However, ff processing in SCAN requires specific order to be set than you cannot change it w/o rewriting the code.
--sb--