Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Any use indexing LEFT(Name,10) when Name is indexed ???
Message
De
30/09/1998 19:58:46
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00142379
Message ID:
00142623
Vues:
35
>Hi,
>
>We have an index on the field 'Name'. If we are using LEFT(Name,10) when performing a search, is it faster if we create an index on this expression or can the search use the index on Name ??

Hi Klas,
Is SET EXACT is OFF then there will be no difference using SEEK() functions.
Also SQL statements of the form
1.) SELECT * FROM Mytable WHERE Name = m.searchname
will be optimised but
2.) SELECT * FROM Mytable WHERE LEFT(Name,10) = m.searchname
won't be.
If LEN(m.searchname) is <= 10 then 1. will work the same as 2 -
so you don't need the special index
HTH
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform