Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to improve the speed
Message
 
 
À
09/02/1999 13:49:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00185626
Message ID:
00185635
Vues:
16
>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

Why don't you import the entire file first then:
set deleted off
delete all
Index on phone tag phone_u unique
set order to phone_u  && un-necessary step. put in for clarity
recall all
delete tag phone_u
pack
If this is an intermediate step before importing new records into an existing master table, I would still do the above, then set a relation on phone number into the master table. Then you can issua a DELETE FOR EOF("MasterTable"). Then you can append [or SQL INSERT] the existing records to the master table.
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform