开发者

Need to search for names, but have no Freetext index

开发者 https://www.devze.com 2023-03-06 17:26 出处:网络
I have a need to search names in our table, but w开发者_JAVA技巧e don\'t have a FREETEXT index setup.This isn\'t an option anymore due to the large amount of data in the table.

I have a need to search names in our table, but w开发者_JAVA技巧e don't have a FREETEXT index setup. This isn't an option anymore due to the large amount of data in the table.

Is there any alternatives that I can do? Essentially I'd be looking at doing:

SELECT *
  FROM MyTable
 WHERE FREETEXT(FirstName, @firstname)

Any ideas or pointers would be greatly appreciated.


Without full text indexes, then you'd maybe consider using

WHERE FirstName LIKE '%' + @firstname+ '%'

However it doesn't scale well (linearly, scan of all rows).

And you have a "large amount of data" which means you really should have full text indexes

0

精彩评论

暂无评论...
验证码 换一张
取 消