SELECT * FROM Eateries WHERE Description LIKE ‘%cafe’

Users want to find all instances for the data in the column description ending with “café.” You therefore create a stored procedure that uses a query such as:
SELECT * FROM Eateries WHERE Description LIKE ‘%cafe’
Users start complaining about slow query response times. Why?


Answer – The syntax forces a table scan, the slowest of all execution plan options.


(Whenever SQL Server must find something that starts with any letter, or must find something negative—for example, IS NOT NULL—it must do a table scan. A table scan means the search starts at the beginning of the table and reads through all entries. This is the slowest of all possible execution plans.)