![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
There definitely seems to be a major difference in doing SQL selects from Foxpro 8 to FoxPro 9. Specifically FoxPro 9 seems to handle indexes comprised of multiple fields differently from FoxPro 8. For example, suppose you had an index like this: alltrim(lastname)+alltrim(str(idnumber,10,0)) In FoxPro 8, you could do a select with the exact index expression on the left of the WHERE clause in your SQL statement. In FoxPro 9, the statement apparently will not be optimized. To achieve the same result, you would have to have an index on a single field expression and put that first in your where clause. For example, supposing you wanted to find someone by idnumber and lastname, assuming you have an index on idnumber, you would use: where idnumber=TargetNumber and alltrim(lastname)=TargetName Or am I missing something? Kevin Clark Seton Home Study School |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
I don't know if such expressions were fully optimized in FoxPro 8. I do know that I have run into several occasions where FoxPro 8 would return instant results and FoxPro 9 takes a very long time. So there must be some difference in the SQL engine in FoxPro 9 that would account for this. It's not a big problem since the query can be rewritten or a new index created if necessary, but there is definitely a difference. Kevin Clark Seton Home Study School |
![]() |
| Thread Tools | |
| Display Modes | |
| |