Hi Sergey,
you are absolutely right, of course. The documentation for the LIKE operator is terrible, you really have to dig hard to find it. I have no experience with SQL server, so I tried the syntax which seemed most likely to me, LIKE 'X*' in stead of LIKE 'X%'.
>
>Our tests showed partial optimization for LIKE clause and full optimization for =. Now, I thought I read somewhere that VFP 9 has full optimizable LIKE, but I don't remember, where I read it, so do not know, if it's true.>
>The LIKE operator in the form
LIKE "sometext%" is partialy optimized in VFP8 and fully optimized in VFP9 with proper indexes.
>
CREATE CURSOR test (fld1 C(10), fld2 C(10))
>INDEX ON fld1 TAG fld1
>INDEX ON DELETED() TAG Deleted
>lcTxt = ""
>SYS(3054,11, "lcTxt")
>SELECT * FROM test ;
> WHERE fld1 LIKE "A%" ;
> INTO CURSOR test1
>
>* Results
>* VFP8
>Using index tag Fld1 to rushmore optimize intermediate result
>Using index tag Deleted to rushmore optimize intermediate result
>Rushmore optimization level for intermediate result: partial
>* VFP9
>Using index tag Fld1 to rushmore optimize intermediate result
>Using index tag Deleted to rushmore optimize intermediate result
>Rushmore optimization level for intermediate result: full
>
>
>
>
>I used SET ANSI OFF in order to use =, but I belive, it makes now everything not generic, since other back-ends use ANSI ON. So, it looks like I have to use LIKE clause if I want to easy switch back-end.>>