Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 16 Aug 2006 @ 09:56:46 GMT


     
  <Prev Next>   <<First <Prev
Next>
Last>>
 


Subj:   Re: Very Long Running Query
 
From:   Victor Sokovin

  I have a query that has been running for approximately 26 hours. Is there a way to tell how close it is to be completed?  


  We are unable to process other jobs on the system due to the table being locked.  


  I have tried raising the priority of the query about 9 hours ago but that doesn't seem to have helped. I also think we would not want to kill the query to to rollback time.  


If you worry about the rollback then the query is not just a SELECT. It inserts or updates rows. You can try counting the number of inserted or updated rows specifying the read-level lock on the target table(s). If you rerun the query every minute or so you should be able to estimate the rate of inserts/updates. If you can estimate the total number of rows to be modified by the query (perhaps using statistics of the prvious runs) you can get an idea of how long the query is about to run and decide whether to let it run or kill it.

BTW, cancelling a long-running rollback should not be a big issue. Just check the recent archives for the details. In very bad cases you might need to restore the table after that but it might still be faster than waiting for the query or its rollback.


Regards,

Victor



     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023