Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help Improving Select Speed
Message
From
09/12/2000 10:57:45
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00450195
Message ID:
00451156
Views:
34
>The short answer is that % on the left side of a string is not optimizable. Think about it, the index is (logically) sorted alphabetically, that means all of the "A"s come first and you know where to find them quickly. How do you use the index to find everything with an "A" in the second position? They're not sorted that way, so the "A" in the second position will be scattered throughout the index.
>
>If you're looking for "AB" you can go to the "A"s, then find the "B"s within the "A"s. As long as the thing you're searching for is on the left side and the % is on the right, the index can be used to optimize the serach.
>
>The substr(x,2) tag puts everything in order starting with the second character so you can find all of the "A"s in the second position using the index.

This does make sense. Short of using PHDbase, the only other thing I have in store for this was to use a separate table with all the words mentioned in the given field, plus the PK of the original record. I used it for keyword-based phone directory search, so the user could include any number of words that an entry could be searched by. You wouldn't believe how many people included nicknames :)

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform