Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Very Slow SQL , Why?
Message
 
To
09/08/1998 07:32:18
Rick Clarke
Fotobae Pty. Ltd.
Adelaide, Australia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00122940
Message ID:
00125099
Views:
17
>&SQLString="BETWEEN(num1,num2) AND INLIST(Filed,A,B,C,D) AND ALLTRIM(UPPER(STATE) = ALLTRIM(UPPER(STATE)) AND AND AND etc.." upto perhaps 20 criteria.
>
>SELECT Field1,Field2 - Field57;
>+WHERE t1.Key=t1.Key etc. etc.;
>+&SQLString;
>+etc... etc... INTO CURSOR MYCURSE. **(Pun Intended)**
>

Rick,

Do you have an index on ALLTRIM(UPPER(State))? If you don't then that criteria is not optimized. The index expressions must exactly meet the criteria. BTW, using ALLTRIM() in an index expression is a waste of time, as VFP will pad every item out to the field length.

Also for doing further selects from the cursor you need to add the NOFILTER option to your selects. With NOFILTER you won't need to use tables as the result.
Previous
Reply
Map
View

Click here to load this message in the networking platform