我有这个查询在SQL Server中运行速度非常慢。请建议优化它以加快运行速度。寻找SQL Server查询优化
TABLE_A
具有100'000'000行TABLE_B
具有1'000'000行
两个表对ID
,Modify_Date
和Source
列非聚集索引。
查询:
Insert into TABLE_A
select * from RABLE_B B
Where NOT Exists (Select 1
From TABLE_A A
Where B.ID = A.ID
And B.Modify_Date = A.Modify_Date
And B.Source = A.Source)
如果你没有不已:加** **好聚集键两个表! –