Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 11 Oct 2005 @ 19:20:23 GMT


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


Subj:   Re: Redestributing large tables instead of replicating a small table
 
From:   Mirjam Berger

Howard,

I don't have a DB here now, but off the top of my head I think you need to do the grouping on the large table column, rather than the small one, for it to take effect.

So, if the qeury you provided:

     sel
     t1.small_table_code
     ,t1.small_table_description

     ,sum(t2.large_table_measure)

     from small_table t1
     ,large_table t2

     where
     t1.small_table_pi=t2.large_table_column

     group by 1,2;

Is equivalent to:

     sel
     t2.large_table_column
     ,t1.small_table_description
     ,sum(t2.large_table_measure)
     from small_table t1
     ,large_table t2
     where
     t1.small_table_code=t2.large_table_column
     group by 1,2;

You might see a different explain.


Hope this helps :)

Mirjam



     
  <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