I trying to filter over a million records that was import by the third party database. The reason for filtering is that the data contain too many junk name. The query below is taking to long to run, and I just wondering if anyone have any suggestion on how to speed thing up a bit. thanks select T.DocID from JunkName T inner join NameRef W on T.surname like '%' + W.CommonName + '%' group by T.docID
The indexes that you mention, are they only on the columns that I mentioned? Do not expect much improvement when there is a wildcard at the start of the search string.