Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is it possible for SELECT to be faster?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00150454
Message ID:
00150753
Vues:
31
>>>Now I have changed my SELECT-command to check if it going faster if I only use
>>>one table and one textbox, but I still have to wait as long as the first time before I get my results. I realy don't get it.
>>>
>>>SELECT Bedrijf.DossierNr, ;
>>> UPPER(Bedrijf.BedrNaam) ;
>>> FROM Bedrijf ;
>>> WHERE UPPER(Bedrijf.BedrNaam);
>>> =ALLTRIM(THISFORM.txtBedrNaam.VALUE) ;
>>> ORDER BY 2 ;
>>> INTO CURSOR Result
>>
>>Afier, you changed WHERE clause including UPPER,ALLTRIM there, and if you get the same time, it may indicate only that you didn't use Rushmore in both cases. So first thing you can do is to use SYS(3054) to check Rushmore. If result is negative, then you should provide Rushmore optimization for you query. It means that all join and filter condition expression should be literally the same as some table tag expresssion. For example, in your second case, table 'bedrijf' should be indexed on 'UPPER(bedrnaam)'. Also, you still have to use DELETED() tag.
>
>Thank you very much for your answer. Stupid of me not to use the index. Everything is working very fast now! Many thanks!!!!!!!!!!

Afier, you may be able to speed it up even faster if you had a line at the beginning which sets a variable:

cBedrNaam = ALLTRIM(THISFORM.txtBedrNaam.VALUE

then use the variable in the SQL instead of using the form value.

SELECT Bedrijf.DossierNr, ;
UPPER(Bedrijf.BedrNaam) ;
FROM Bedrijf ;
WHERE UPPER(Bedrijf.BedrNaam) = cBedrNaam ;
ORDER BY 2 ;
INTO CURSOR Result

HTH
Barbara
Barbara Paltiel, Paltiel Inc.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform