Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL LIKE and Rushmore optimization
Message
From
20/01/2006 10:42:30
 
 
To
20/01/2006 10:24:10
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01088808
Message ID:
01088915
Views:
18
Fabio,
Thank you.
Its realy displays FULL in VFP9.. but in VFP8S1 its always "partial" or "none"..
In my case I need to use "X%C" expression.. and here no chance to get it optimized.. but in any case - your message was very usefull for me.

Denis.

>>Hello Fabio,
>>Thanks for response.
>>
>>Very interesting
>>
>> exist an index cexp with collate MACHINE
>>LEFT('cstring',1)<>'%' OR '_'
>>
>>
>>I have next simple SQL
>>
>>SELECT * FROM table WHERE UPPER(description) like "HP%DRUCKER" INTO CURSOR _resultset
>>
>>I check - no "%" and no "_" as LEFT(description,1) present
>>I set SYS(3054,1,"lcOptimizeLevel")
>>Execute SQL
>>I'v got next result
>>Using index tag descr1 to rushmore optimize table
>>Using index tag deleted to rushomre optimize table
>>Rushmore optimization level for table : Partial !!
>>
>>Why "partial" ? Difficult to understand.. Index Expression - Ok.. no "%","_"..
>>
>>SELECT * FROM table WHERE UPPER(description)="HP" INTO CURSOR _resultset
>>
>>returns "FULL"..
>>
>>But so far as I know.. LIKE supports rushmore optimization... whats wrong?
>>
>>Denis
>>
>>
>Hi Denis, none is wrong.
>VFP8SP1 have a bug on SYS(3054), and return 'partial' with every optimizable LIKE
>
>this is fixed on VFP9SP1, and this explain
>
>CREATE CURSOR TESTLIKE (CC C(200))
>APPEND BLANK
>REPLACE CC WITH ' Y  C'
>INDEX ON CC COLLATE 'MACHINE' TAG T1
>
>
>CLEAR
>
>SYS(3054,12)
>SET DELETED OFF
>TEST()
>
>SET DELETED ON
>*
>TEST()
>
>DELETE TAG ALL
>
>INDEX ON CC COLLATE 'MACHINE' FOR NOT DELETED() TAG T2
>SET DELETED OFF
>TEST2()
>
>SET DELETED ON
>*
>TEST2()
>
>PROCEDURE TEST
>
>SELECT * FROM TESTLIKE WHERE CC LIKE 'X' INTO ARRAY AA&& DELETE OFF = 'Full'  ON = 'Partial'
>
>SELECT * FROM TESTLIKE WHERE CC LIKE 'X%' INTO ARRAY AA && DELETE OFF = 'Full'  ON = 'Partial'
>
>SELECT * FROM TESTLIKE WHERE CC LIKE 'X%C' INTO ARRAY AA && DELETE OFF = 'Partial'  ON = 'Partial'
>
>PROCEDURE TEST2
>
>SELECT * FROM TESTLIKE WHERE CC LIKE 'X' INTO ARRAY AA && DELETE OFF = 'none'  ON = 'Full'
>
>SELECT * FROM TESTLIKE WHERE CC LIKE 'X%' INTO ARRAY AA && DELETE OFF = 'none'  ON = 'Full'
>
>SELECT * FROM TESTLIKE WHERE CC LIKE 'X%C' INTO ARRAY AA && DELETE OFF = 'none'  ON = 'Partial'
>
>
>'partial' it means that VFP doesn't complete the selection through an AND on the indexes,
>but it has to make other comparisons in the record
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform