小编Lou*_*ise的帖子

SQL查询优化不存在

我需要优化以下查询,有人可以帮忙吗?我知道这是导致问题的不存在部分,因为它正在进行大规模的表扫描,但我是新手,有人可以给出任何建议吗?

select count(*)
from Job j
where company = 'A'
and branch = 'Branch123'
and engineerNumber = '000123'
and ID > 60473
and not exists(
select JobNumber, Company, Branch
from OutboundEvents o
where o.JobNumber = j.JobNumber
    and o.branch = j.branch
    and o.company = j.company
    and o.Formtype = 'CompleteJob')
Run Code Online (Sandbox Code Playgroud)

sql optimization sql-server-2005

1
推荐指数
1
解决办法
134
查看次数

标签 统计

optimization ×1

sql ×1

sql-server-2005 ×1