Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 07 Nov 2012 @ 09:22:21 GMT


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


Subj:   Re: How DISTINCT and GROUP BY have same performance in TD 14
 
From:   Dave Wellman

Hi,

What makes you think that " DISTINCT will always go for a full table scan "?

Whether you need an FTS or not is dependent on indexing and selection criteria, not on the function that is then performed with qualifying rows.

As to why they have the same performance in TD 14? They don't.

There are still two aggregation algorithms in TD 14, each of which performs better than the other in certain circumstances. What has changed in TD 14 is what determines whether one algorithm or the other is used.

Prior to TD 14 it was your SQL code that made this determination. Using DISTINCT or GROUP BY controlled which algorithm was used.

With TD 14, the algorithm is chosen by the optimizer based on the data demographics (i.e. stats or dynamic sampling).


Cheers,

Dave

Ward Analytics Ltd - Information in motion (www.ward-analytics.com)



     
  <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