Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is better and faster
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
00977833
Message ID:
00978358
Views:
33
>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.
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform