General information
Category:
Coding, syntax & commands
>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only