我的查询表现不佳并希望改进它:
select top 10 Id, UpdateDate, Source, WordBag
FROM Search.WordBagCurrent with (nolock)
WHERE
contains (WordBag,'"101*" and "n*" and "croft*" and "ave*"')
ORDER BY UpdateDate DESC
其中WordBag是一个列(varchar(351)),而不是null。
我尝试了其他重做此查询的方法,例如使用containsstable:
select top 10 a.Id, a.UpdateDate, a.DataSource, a.WordBag
from Search.WordBagCurrent as a
inner join
containstable(Search.WordBagCurrent, WordBag, '"101*" and "n*" and "croft*" and "ave*"')
as key_tbl
on a.ValuationId = key_tbl.[key]
order by a.UpdateDate desc
这两个查询的执行计划表明它们几乎相同。我还能做些什么来改善这些查询的性能?我也尝试过使用' top_n_by_rank'在包含稳定但我们需要所有结果。