sql - 改进 sql 中的文本搜索

标签 sql sql-server

如何在不使用 like '%%' 表达式的情况下改进 sql 中的文本搜索,并使搜索更快

最佳答案

使用 SQL Server 的 Full-Text Search特点:

In contrast to full-text search, the LIKE Transact-SQL predicate works on character patterns only. Also, you cannot use the LIKE predicate to query formatted binary data. Furthermore, a LIKE query against a large amount of unstructured text data is much slower than an equivalent full-text query against the same data. A LIKE query against millions of rows of text data can take minutes to return; whereas a full-text query can take only seconds or less against the same data, depending on the number of rows that are returned.

另请参阅:How to enable Full-text Indexing in SQL Server 2005 Express?

关于sql - 改进 sql 中的文本搜索,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8960077/

相关文章:

mysql - 获取所有具有重复电子邮件地址的用户

c# - 如何从 gridview 将多条记录添加到 SQL Server 表中?

sql - 如何检查某些表是否为空?

sql-server - 如何从两列中按值获取行限制

php - Mysql Where Column A = X and Column B = Y and or Column B = Z

php - SQL 和 PHP - mysqli_num_rows() 或 'select count()' 哪个更快?

SQL : how to find leaf rows?

python - 如何在不确定数量的参数上使用 LIKE 和 % with pymssql?

c# - 如何从 C# 生成数据库表以对数据库进行版本控制?

SQL:使用 CASE 将一个表中的记录与另一个表中的记录连接起来