【发布时间】:2015-07-09 02:59:22
【问题描述】:
我遇到了查询性能问题。我的 where 子句包含,
where .....(type = c) and not (( type = a ) or contains ( ftstype, N'b' ))
如果没有“and not”部分,查询似乎更快。
我想检查“and”是否比“or”更便宜,以便我可以使用以下(根据 demorgans 规则,[c and (a or b)' = c and (a' and b ')])
where .....(type = c) and ( not ( type = a ) and not contains ( ftstype, N'b' ))
我还想检查查询优化器是否考虑了这种转换,以及确定更好的执行计划。 (我不了解 SQL 服务器估算计划。)
【问题讨论】:
-
你应该为你的请求的每个版本提供 sql server 估计计划。
标签: sql sql-server full-text-search query-performance sqlperformance