The second (assuming you means CONTAINS
, and actually put it in a valid query) should be faster, because it can use some form of index (in this case, a full text index).
(第二个(假设你的意思是CONTAINS
,实际上把它放在一个有效的查询中)应该更快,因为它可以使用某种形式的索引(在这种情况下,是一个全文索引)。)
Of course, this form of query is only available if the column is in a full text index. (当然,只有当列在全文索引中时,才能使用这种形式的查询。)
If it isn't, then only the first form is available. (如果不是,那么只有第一种形式可用。)
The first query, using LIKE, will be unable to use an index, since it starts with a wildcard, so will always require a full table scan.
(使用LIKE的第一个查询将无法使用索引,因为它以通配符开头,因此始终需要全表扫描。)
The CONTAINS
query should be:
(CONTAINS
查询应该是:)
SELECT * FROM table WHERE CONTAINS(Column, 'test');
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…