Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 21 Oct 2003 @ 16:19:04 GMT


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


Subj:   SQL Problem.. Help Needed
 
From:   Rick Davis

TABLE1 has

NUPI on (col1,col2,col3,Col4,Col5,Col6,Col7,col8)
NUSI on (col1,col2,col3,Col4,Col5,Col6,Col7)

Total No:Of Rows = 1,802,069
Unique values on NUPI = 1,802,069
Unique values on NUSI = 180,405
-----------------

TABLE2 has NUPI on (col1,col2,col3,Col4,Col5,Col6,Col7) 180405

Total No:Of Rows = 180,405
Unique values = 180,405
-----------------

TABLE3 has NUPI (col1,col2)

Total No:Of Rows = 490
Unique values = 490
-----------------

SEL
   *
FROM TABLE1 AS A
INNER JOIN
     TABLE2 AS B
ON
      A.COL1 = B.COL1 AND
      A.COL2 = B.COL2 AND
      A.COL3 = B.COL3 AND
      A.COL4 = B.COL4 AND
      A.COL5 = B.COL5 AND
      A.COL6 = B.COL6 AND
      A.COL7 = B.COL7
INNER JOIN
     TABLE3 AS C
ON
      B.COL1 = C.COL1 AND
      B.COL2 = C.COL2

the above SQL works fine with sel * , and its pretty fast like < 10 seconds, instead of sel * , if is specify particular columns from all the 3 tables , the SQL just running for ever with 98% skewed on PMON .

NUSI on Table1 is creatin problem ? We are on V2R5

Any help would be highly appreciated


TIA,

Rick



     
  <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