Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 06 Mar 2007 @ 11:18:54 GMT


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


Subj:   Re: Performance of a self join
 
From:   Michael Larkins

Goutham P:

This is much better in that I now see the reason for using a derived table. You are actually doing the aggregation inside the derived table - perfect. Plus, you are combining OLAP (on aggregated data) and aggregation inside of the same query - perfect reason to use a derived table since they are not compatible in the same SELECT (OLAP keeps detail data and aggregation does not).

With that being said and the fact that I am in a time zone 6 hrs from home and this is only day two in that time zone, I might be missing something. However, why are you still joining the tables together?

I don't see the benefit. I don't see a residual condition in the WHERE to justify comparing the detail rows with the aggregated data. The data is all from the same table - of course it is going to match. I may be experiencing jet lag and not thinking clearly, but please explain to me/us why the need for the join.


Thanks in advance,

Michael Larkins
Certified Teradata Master
Certified Teradata SQL Instructor



     
  <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