Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Searching for a substring in a field - fastest way
Message
From
10/03/2017 04:53:42
 
 
To
10/03/2017 04:43:55
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01648880
Message ID:
01648895
Views:
55
>>What is the fastest way to search through a file to find a substring within a field? I know you can
>>
>>set filter to 'xyz" $ yourfield
>>go top
>>
>>or an SQL Select equivalent, but in a file where there are thousands of records, it takes a long time, specially on a network...
>>Is there a quicker way?
>
>If you have a limited set of sub-strings to search for, you can
>
>index on 'xyz" $ yourfield tag xyz_ binary
>
>
>Then any search will get optimized

I'd either use binary as you did for faster execution, less memory overall or
index on at('xyz", yourfield) tag xyz
on the chance of position becoming relevant at some future point in in time and query for at()>0 if going the index way ;-)
Previous
Reply
Map
View

Click here to load this message in the networking platform