开发者

Need to search for names, but have no Freetext index

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜