Search code examples
sqlsql-serverselectquery-optimization

SQL Server Index - Any improvement for LIKE queries?


We have a query that runs off a fairly large table that unfortunately needs to use LIKE '%ABC%' on a couple varchar fields so the user can search on partial names, etc. SQL Server 2005

Would adding an index on these varchar fields help any in terms of select query performance when using LIKE or does it basically ignore the indexes and do a full scan in those cases?

Any other possible ways to improve performance when using LIKE?


Solution

  • Only if you add full-text searching to those columns, and use the full-text query capabilities of SQL Server.

    Otherwise, no, an index will not help.