Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem Updating records in table via SCAN loop
Message
 
 
To
07/06/2002 10:26:11
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00665663
Message ID:
00665973
Views:
28
>>>> '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.
>
>Do you know how R.O. affects SCAN WHILE? I often use a SEEK < parent key>, followed by a SCAN WHILE < still on same parent key >.
>

There's no R.O. is involved in this case because WHILE clause is not R.O. optimizable.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform