Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Searching for a substring in a field - fastest way
Message
De
10/03/2017 04:53:42
 
 
À
10/03/2017 04:43:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01648880
Message ID:
01648895
Vues:
54
>>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 ;-)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform