Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

how to optimise update query

$
0
0

Hi,

If following query, i tried to check the  plan i noticed both where same

pls suggest as thum of rule what should be followed.

thought i will check plans in each cases.

1)

update t1 
set a, b, c, d .f
from t1 a
join t2 b on a.t1id=b.t1id
where b.poleid =1

2)

update t1 
set a, b, c, d .f
from t1 a
join t2 b on a.t1id=b.t1id
where a.poleid =1



--t2 keeps poles and poleid is pk
--t1 keeps poles report and does not have any index right now, we are planning for (includes)
it is 2 times bigger than t1 

q1) which where clasue i should select
q2) should i revers the join by putting t2 first and t1 second.

yours sincerely


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>