Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
First query of view very slow
Message
From
27/09/2004 13:01:52
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
27/09/2004 11:35:17
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00945788
Message ID:
00946337
Views:
21
>>Hi Dodi
>>
>>>SELECT * FROM tacust WHERE tacust.cmrno = ?mcmrno AND tacust.actflag = "1"
>>>(in the form, the user enters a customer number (into the variable mcmrno) then it requeries the view)
>>
>>You can get some minor improvement by adding m. like this...
>>
>>where tacust.cmrno = ?m.mcmrno
>>
>>>
>>>CMRNO is already indexed in TACUST file.
>>>
>>>I did some research and tried different approaches. Tried using DEL tag on DELETED() but no improvement. I also tried adding ACTFLAG as index (for Rushmore optimization) but it did not help. SYS(3054,1) stated that Rushmore optimization level for table TACUST is none. I don't understand.
>>
>>The fact that it's saying no optimization means there's something wrong with your indexes and/or where clauses. For example if you have an index on UPPER(cmrno) then you query with WHERE cmrno = ?m.mcmrno, that cannot optimize. You'd have to change the where clause to WHERE UPPER(cmrno) = ?m.mcmrno
>
>Hello Mike, this is why I don't understand - the index and the where clause are exactly the same, CMRNO + ACTFLAG. :-\

Could you clarify that? CMRNO + ACTFLAG is not the same as WHERE UPPER(cmrno) = something AND actflag = somethingelse.

To use an INDEX ON CMRNO + ACTFLAG, your where clause would have to be WHERE CMRNO+ACTFLAG = ?m.mcmrno+"1"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform