Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 07 Mar 2003 @ 09:33:51 GMT


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


Subj:   Re: The Column order in Primary index
 
From:   Dieter Nöth

Chuck McDevitt wrote:

  Teradata could "remember" what order you said on the primary index clause, but there isn't any reason to do so, since it doesn't affect how the data is actually stored.  



But it also affects how statistics are stored.

ct foo(col1 char(20), col2 int);
create Index bar(col1 char(20), col2 int) on foo;
collect statistics on foo index bar;


Within statistics there's only a maximum of 16 bytes of data stored:

--> First 16 bytes of col1, no data for col2

ct foo(col1 int, col2 char(20));
create Index bar(col1 int, col2 char(20)) on foo;
collect statistics on foo index bar;


--> col1, First 12 bytes of col2

IMHO this one is better for the optimizer, because there's more info.


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: 27 Dec 2016