Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Slow 'Use'
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00290944
Message ID:
00290980
Vues:
11
>Why is the following code slow?
>
>Select * from myTable into cursor tmpTable
>Use Dbf("tmpTable") Again
>
>myTable has only 5 rows. The Select is quick but the Use Dbf("tmpTable") Again takes about 15 seconds.
>

The most likely cause is that the files doesn't really 'exist' until the second line is executed.

A SQL Select into a cursor, while it will associate a file name with it, in many cases doesn't actually create the file - it exists only in memory. When you issue the second line, if it's only in memory, the the file must be creted phsycially on disk, and the internal paperwork done, before it can be actually USEd.

Warning - the first line of code issues may make a filtered view. In this case, that means that you'd simply open the entrie source table again with an alias. If you do something that may be Rushmore optimizable against a single table, if you need to actually open it again, you'd best add a NOFILTER clause.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform