Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
LOCATE x GO TOP
Message
From
02/11/2005 18:20:17
 
 
To
02/11/2005 17:57:53
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 7 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01064195
Message ID:
01064778
Views:
39
This message has been marked as a message which has helped to the initial question of the thread.
>Fred, Mike and Terry,
>
>Thanks for your answers.
>
>Using your suggestion, I used SET FILTER, and got these results :
>
>GO TOP : 36 Seconds
>LOCATE : 23 Seconds
>
>Is this the expected difference ?
>
>Regards
>
>Cesar

That depends. Filtering in general can be slow. But I've never noticed any times anything like that. If your filter condition matches an index tag, the times for the LOCATE should be the same as a SEEK would produce, almost instant (though it's usually slower).

Say you had a tag named lastname on a lastname field. If you SET FILTER TO lastname="Smith" and then did a GO TOP, it might take a fair bit of time, while the LOCATE should be nearly instant. It may also depend on how many deleted records you have and if SET DELETED is ON or OFF.

If you need to get to the last record that matches a filter, you can SET ORDER TO TAG lastname DESCENDING, and then do the LOCATE. This would be much faster than a GO TOP or a GO BOTTOM.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform