Index seek possible or not

  • I have some queries that use wild characters in the WHERE clause

    select name, address, city, number from employees where name like '%John%

    If I create an index on the column name then will the SELECT query make use of that index? I doubt that will happen because the searched name 'John' could be anywhere in the record.

    Am I correct on this?

    Blog
    http://saveadba.blogspot.com/

  • It could make use of the index, but it would be a scan not a seek.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply