我在链接服务器上有这个查询
Select a.PawnMainID into #ExistingID
from Beautifly.BIOS_PAWN.dbo.tblPawnMain a
inner join Transactions.tbl_PawnMain c
on a.PawnMainID = c.fld_PawnMainID
inner join Reference.tbl_BranchRowVersions b
on cast(a.[PawnMainID]/1000000000000 as decimal (38,0)) = b.fld_ID
where (a.StatusID between 3 and 5)
AND a.RowVersionBo > b.fld_MaxRowVersion
并且它需要很长时间才能完成,而其他代码似乎完全正常你能帮我找出问题吗?我的代码注释足够高效吗?如果是这样,我该如何改进?
下图显示了我的执行计划,重新远程查询的成本为 99%!
我还想问一下我的代码是否优化了?如果不是,我该如何优化它?