Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 28 Aug 2009 @ 10:22:10 GMT


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


Subj:   Re: Parsing of SQL in teradata
 
From:   Victor Sokovin

  My question was exactly that when I write a sql (before I actually do the explain),do I need to worry about the order of where and join clauses ? Or anyhow I put it the teradata v2r6 optimizer is 'smart' enough to give me a low cost way of executing the same?  


You may worry about the *number* of joins and clauses rather than their order. Try to avoid unnecessary or fancy ones because they increase the number of branches on the decision tree the optimizer has to go through. You potentially will also need to collect more statistics for all those nice-to-haves to really work. Whether the optimizer will find the best path is a question but you always lose the time on that extra work the optimizer has to perform, and regular statistics collection is not an easy job either. Also, when queries get really complicated execution plans tend to become less stable. They may change depending on demographics. Sometimes you may prefer stability and less surprises in this department even at the price of a somewhat suboptimal performance.


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