Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 21 May 2009 @ 15:10:23 GMT


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


Subj:   Re: Column Order in Derived Table
 
From:   Dieter Noeth

Srikanth Goli wrote:

          > SEL ....
          > FROM A
          > Join (Sel  
          >         From B
          >         Where ..
          >      )C
          > ON A.Col1 = B.Col1
  Does it use the first column in the derived table B as the PI OR does the optimizer understand that regardless of location of B.Col1, that needs to be driver for distribution / hashing? I understand that with standalone "Create Tables As", this is a factor and that first column either be the PI column, or PI be explicitly specified. But with a derived table, where optimizer has access to statistics and query, does it still need the user specify the order?  


No, the order of columns shouldn't matter.

In TD12's Explain you'll see on which column(s) a spool is redistributed. Before TD12 you need to submit a "DIAGNOSTIC VERBOSEEXPLAIN ON FOR SESSION" to get that detail in explain.


Dieter



     
  <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