Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SCAN is too slow
Message
De
14/06/2002 02:18:15
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00668312
Message ID:
00668393
Vues:
19
>I friend of mine did a program as below and complains
>scan is too low.
>He as 3,000,000 records
>He wonder if the struct is correct or is there a better way
>to do that.
>Tables are into a database
>
>sele tabela A
>set order to indice
>sele tabela B
>go top
>scan
>sele tabela A
>seek(tabela B.campo)
>if found()
>replace value from tabelaB to tabelaA
>sele tabela B
>endif
>endscan

Moises,
Skeleton code does a lot of unnecessary workarea switch, not optimizable go top etc.
It could be written this way too :

sele tabelaB
scan for seek(tabelaB.campo, 'TabelaA','indice')
replace value from tabelaB to tabelaA in tabelaA
endscan

Or assuming TabelaB.campo also have an index on it :

select TabelaA
replace value from tabelaB to tabelaA ;
for seek(TabelaA.Indice, 'TabelaB', 'Campo')

I'd then choose the table with lesser records.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform