| 
	
 | 
 Posted by 001 on 11/07/05 09:08 
Hello, 
 
The select statement needs only 1 second to complete the query. 
But the update statement spends 30 minutes. Why? 
 
 
SELECT STATEMENT: 
declare @IDate smalldatetime 
 select @IDate=col001 from USDay 
select * from  USDay A 
  join  ( 
   select US990010, US990020, US990030, US990040, US990050, US990060,  
US990070 from US99000D where US990010=@IDate 
   ) B on A.col001=B.US990010 and A.col002=B.US990020 
 where B.US990010 is not null 
 
 
UPDATE STATEMENT: 
update US99000D 
 set  US990030=A.col003, 
  US990040=A.col004, 
  US990050=A.col005, 
  US990060=A.col006, 
  US990070=A.col007 
 from  USDay A 
  join  ( 
   select US990010, US990020, US990030, US990040, US990050, US990060,  
US990070 from US99000D where US990010=@IDate 
   ) B on A.col001=B.US990010 and A.col002=B.US990020 
 where B.US990010 is not null 
 
 
INDEX: 
clustered index: US990020, US990010 
non-unique index: US990010, US990020
 
[Back to original message] 
 |