这是我以前的查询的延续
DDL
CREATE TABLE [dbo].[t](
[words] [varchar](1000) NULL,
[id] [int] IDENTITY(1,1) NOT NULL
) ON [PRIMARY]
DML
insert into t(words)values('this is my laptop')
insert into t(words)values('this does not contains heqadphone')
这两个插入被迭代 250 次......
SQL 查询 - 1
SELECT * FROM
t as t
JOIN CONTAINSTABLE(t, words,'"*heqadphone"') fulltextSearch
ON
t.[Id] = fulltextSearch.[KEY]
SQL 查询 - 2
Select * from t where words like '%heqadphone%'
困惑
通常,我们建议不要使用我稍后查询中所述的双倍 %% 。但是在检查 SQL Profiler Reads and Duration 之后
查询 1 显示更多 reads/duration 。点击以下链接查看详情
查询 2 显示较少的 reads/duration 。点击以下链接查看详情
您能否确认,理想情况下哪个查询可以很好地使用?