Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 11 Feb 2010 @ 14:52:35 GMT


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


Subj:   Re: Help required in optimization
 
From:   John_Wight

It 'appears' that the PI's are the same, but without the DDL from the two tables we can't say.

One thing to look for is the use of DISTINCT. If the projected values are 'VERY' unique, DISTINCT will be faster than a GROUP BY. However, if the projected values are very 'NON-UNIQUE', then you can get skewing and worse performance than using GROUP BY. If you do an EXPLAIN of both ways you can see the difference. Some folk say that GROUP BY is faster than DISTINCT but that is not always the case. It's value dependent on the uniqueness of the data that makes a difference - the less unique the values, the faster GROUP BY will be and the more uniqueness of the values, Distinct is faster.

Don't know if this helps - but just a thought.


JK



     
  <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