I am not exactly sure about MSSQL, but I can tell you how LIKE clauses work in other databases and I assume MSSQL is similar.
You don't have any wildcards in your select so in effect the query becomes:
SELECT * FROM myTable WHERE myTable.columnA = 'bobo'
If you have a traditional non-fulltext index on myTable.columnA then
SELECT * FROM myTable WHERE myTable.columnA LIKE 'bobo%'
can use the index, however
SELECT * FROM myTable WHERE myTable.columnA LIKE '%bobo'
and
SELECT * FROM myTable WHERE myTable.columnA LIKE '%bobo%'
cannot use the index and will cause a full table scan where the server will examine every row of the table. The difference is the wildcard is in the front: '%bobo'. The DB can convert LIKE 'bobo%
' to a range scan on the index, but it cannot with LIKE '%bobo'
because of the nature of tree style indexes.
If you really need to to a LIKE '%bobo' on you data then consider making a derived column myTable.columnB with content reverse(myTable.columnA) and do a LIKE 'obob%'
on it.
If you really need to do LIKE '%bobo%' then you are using your database like a search engine and either need to use full text indexing or consider using an external full text search engine.