Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is it possible for SELECT to be faster?
Message
From
26/10/1998 13:54:49
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00150454
Message ID:
00150578
Views:
15
>>>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 .

Is 'OR' problem reported for VFP6 only and supposed to be fixed soon?
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform