query that executes too long (25 mins)
I have this query on a linked server
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
and it takes forever to finish while other codes seemed to be normal at
all can you help me identify the problem? is my code note efficient
enough? if so how can i improve it?
the picture below shows my execution plan having re remote query a cost of
99%!
No comments:
Post a Comment