Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Letters should be found in a string - what is the best?
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00428574
Message ID:
00429028
Vues:
16
>Hi, Nadya!
>
>Just my $0.02...
>
>Assume that items in mapto field sorted (it is easy to organize and maintain just in the UI), for example:
>
>1 ABCD
>2 AB
>3 FG
>4 8AF
>5 BFT
>6 AFT
>
>Than, you may use LIKE operator for 'AND' search criteria:
>
>For 1 item still better use $ operatir
>For OR between 2 or more items better to use '$' as well
>For AND - LIKE
>
>Example:
>
>need to find A AND 8 - expression is:
>mapto LIKE '%8%A%'
>
>need to find A AND 8 AND B - expression is:
>
>mapto LIKE '%8%A%B%'
>
>Note that order of items here is significant.
>
>If you you know exactly that 8 and A are adjusten, following will run more quickly:
>
>mapto LIKE '%8A%B%'
>
>HTH.

Hi Vlad,

Yes, I thought about it too, but unfortunately, we don't have them organized this way.
The typical examples :BAD
UAD, etc.

BTW, I ran already bunch of tests, using $ operator and Sergey's ideas and found, what for 2 items $ operator is better, for 3 items first Sergey's idea works faster, but time difference is ~20 sec. and time values like:
&& 3 items
214 s && 2 chrtran
243 s && 3 $
227 s && occurs + chrtran

I run these quieries directly from the server and on one table (1,8 mln. records). From my local machine it should be worse...
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform