Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Slow LOCATE command in _Assign method
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 7
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01463679
Message ID:
01463682
Views:
40
>I'm running into a situation where a LOCATE command is operating slowly, yet it should be blazingly fast. I am doing a LOCATE (with no order set) on the ID field (integer) of a table with about 250,000 records in it. ID is the primary key and ID is the index expression - nothing else. From the command line, a LOCATE on this field is instantaneous (across the network on the live data). But when I open a particular form in the system, it takes about 3.5 seconds. The command happens to be in an _ASSIGN method and I wondered if that could be causing the problem (though I was doubtful). So I took the exact same command and ran it after the call to the _ASSIGN method. Since I was sitting on the record already (due to the LOCATE in the _ASSIGN method), I did a GO TOP before the LOCATE. When that LOCATE command executed (it's in the Init of the form), it only took 0.000799 seconds. So I'm left wondering why one version is slow and one is fast. There's really no reason - given the way the index is built and the data type, as well as the number of records in the table - that a LOCATE should be taking 3.5 seconds. And this is consistent with my testing today. It's about 3.5 seconds each time, though the system admin says he saw the form come up much slower the other day. That may have been due to network traffic. Anyway, I'm wondering if anyone has seen this behavior before.
>
>Thanks,
>
>Russell Campbell

How many times the assign method is called? Can you increment some counter in that method?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform