ahmed elbarbary

ahmed elbarbary

  • NA
  • 1.6k
  • 277.8k

how to write this query for good performance ?

Jan 8 2020 9:08 PM
I have query when i run it take may be 5 minutes to run
so i need to rewrite with good syntax for good performance
but i dont know how to enhance that query
  1. select p.partid,p.maskedid,m.chemicalid into #temp2 from #temp t inner join parts p on ( p.maskedid=t.maskId and p.partid<>t.partId)  
  2. inner join chemicalmaster m on m.partid=p.partid and m.chemicalid<>t.chemicalId  
  3. update t1 set t1.status='conflict data' from #temp t1 inner join #temp2 t2 on  t1.maskid=t2.maskedid   
 so how to enhancement this query please ?

Answers (2)