Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Very Slow SQL , Why?
Message
 
À
09/08/1998 07:32:18
Rick Clarke
Fotobae Pty. Ltd.
Adelaide, Australie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00122940
Message ID:
00125099
Vues:
20
>&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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform