Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any use indexing LEFT(Name,10) when Name is indexed ???
Message
From
30/09/1998 19:58:46
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00142379
Message ID:
00142623
Views:
34
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform