Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to improve the speed
Message
 
À
09/02/1999 16:13:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00185626
Message ID:
00185700
Vues:
22
>>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
>
>One more approach:
>Append the SDF file into a table.
>Set relation to your production table
>Scan the temp table
>Insert into IF !FOUND('production table')
>
>This way only saves time in appends and packs.
>HTH
>Brad

I bet this turns out to be the fastest suggestion.

:)
Rich Addison, Micro Vane, Inc., Kalamazoo, MI
Relax, don't worry, have a homebrew.
- Charlie Papazian, The New Complete Joy of Home Brewing
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform