`select * from DETAIL a
where a.BUILD > GETDATE() - 90 s
and (a.IN + a.Rt) NOT IN (SELECT Sample_IN + Rt FROM SUMMARY)
and (a.Rt + a.Err) IN
(SELECT Rt + Err
FROM SUMMARY
where (sample_in + rt + err) NOT IN
(SELECT in + rt + err FROM DETAIL))
group by a.rt, a.plant, a.in, a.build`
此查询显示性能问题,它在 sql2000 服务器中运行得更快,但在 sql2008R2 中表现不佳。两个环境中的表具有相同的属性(列数据类型和索引)。我猜想选择子句的“+”运算符有一些可能性。谁能帮我 ?