Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need to optimize existing code
Message
De
24/01/2002 17:28:37
 
 
À
24/01/2002 17:14:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00610153
Message ID:
00610163
Vues:
23
>I have the following code that takes forever to run. Can anyone suggest ways of speeding up the process?
>
>select courseid,classid,studentid,birthdate,firstname,middlei,lastname,address,city,state,zip;
>from student;
>where empty(web_exp);
>into table c:\tempweb
>
>The database has over 390000 records. For test data, I'm looking for 42 records and it's taking so long. Should I set an index?
>
Hi Sunshine

DEFINITELY create an index on "web_exp" and see what effect that has.

Next you may need an index on DELETED() to speed things up - that may, or may not, help - but is worth trying as a second pass (there are too many possibilities here to be presecriptive about that one).

Also try and avoid using functions in your filter expressions, use exact comparisons they are usually faster. But you need to check the setting of SET ANSI because that can affect how things behave (see the help file for details)

So instead of

>where empty(web_exp);

use WHERE web_exp == ""
----
Regards
Andy Kramek
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform