Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to improve the speed
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00185626
Message ID:
00185631
Views:
23
Try creating a single index on cPhone and iList (cPhone+STR(iList) if iList is an integer). Then use SEEK instead of LOCATE. If you know there are no deleted records, set DELETED OFF.

>Running VFP 6 on a P133 64MB RAM Windows NT.
>
>I need to import 42 000 records from a SDF file into a table. I also need to eliminate all duplicated phone number for the current list. So, before importing each record, I issue a
>
>LOCATE FOR (iList = lnCurrentList) AND (cPhone = lnCurrentPhone)
>
>IF FOUND()
>   *-- Do not import
>ELSE
>   *-- Import
>ENDIF
>
>
>This work great. The only issue is that the LOCATE command take about 0.2 seconds on average. That may not seem very long, but for 42 000 records, that take more than 2 hours for the whole file.
>
>I'm using table buffering and have an index on iList, cPhone and Deleted().
>
>I tried using a SELECT-SQL instead, but SELECT-SQL will only use the records in the table, not the records in the buffer.
>
>BTW, Sys(3054, 1) on the SELECT-SQL with the same conditions as the LOCATE report full optimization.
>
>Has anybody have a suggestion on how to improve the speed of this validation?
>
>TIA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform