Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need to optimize existing code
Message
From
24/01/2002 17:28:37
 
 
To
24/01/2002 17:14:42
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00610153
Message ID:
00610163
Views:
22
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform