Answer by Martin Schoombee
You are doing a lot of unnecessary work in that query. ...like '%' + @word + '%'...already covers "starts with" and "ends with" criteria, so you' don't need a lot of those conditions.
View ArticleAnswer by Grant Fritchey
The type of search you're providing is one of the most difficult to accomplish. What you're seeing is that using the LIKE '%anything' is causing scans and can only ever cause scans. The first way to...
View ArticleAnswer by TimothyAWiseman
Grant and Martin both have great answers and I echo everything they said. To add on a bit, depending on how this is called you may consider not automatically adding the % wildcard and let the user...
View ArticleAnswer by Mister Magoo
Again, depending on the size of the data, you could consider having a words table. When you store a row in your data table, you also split out the words from the address and record the usage in your...
View Article