Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is it possible for SELECT to be faster?
Message
 
À
26/10/1998 09:38:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00150454
Message ID:
00150576
Vues:
18
>>SELECT Bedrijf.DossierNr, ;
>> UPPER(Bedrijf.BedrNaam), ;
>> UPPER(Straat.Om), ;
>> ALLTRIM(Bedrijf.Nummer), ;
>> StatBedr.Om_NL, ;
>> VestType.Om_NL ;
>>FROM Bedrijf, ;
>> Straat, ;
>> StatBedr, ;
>> VestType ;
>>WHERE Bedrijf.Straat = Straat.Straat ;
>> AND Bedrijf.StatBedr = StatBedr.StatBedr ;
>> AND Bedrijf.VestType = VestType.VestType ;
>> AND &mSeekDosNr ;
>> AND &mSeekBedrNm ;
>> AND &mSeekHandNm ;
>> AND (&mSeekBranch1 ;
>> OR &mSeekBranch2 ;
>> OR &mSeekBranch3 ;
>> OR &mSeekBranch4 ;
>> OR &mSeekBranch5) ;
>> AND &mSeekStraat ;
>> AND &mSeekStatus ;
>> AND &mSeekDatIns1 ;
>> AND &mSeekDatIns2 ;
>>ORDER BY 2 ;
>>INTO CURSOR Result
>
>Firstly, using UPPER,ALLTRIM you slow down the query.

Yup.

>Secondly, you have too many filter conditions.

Yup yup...and the OR's are killing you. There is a documented bug that if you put OR's in your WHERE's your performance will degrade with each execution. You may want to put the OR's in a HAVING clause...

...and make sure you have an index on every field where you have an = sign .
Ken Sorce
Team RAD, Inc.
Rapid Application Developers
Ken@TeamRAD.com
www.teamrad.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform