Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 06 Mar 2003 @ 20:27:18 GMT


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


Subj:   Re: The Column order in Primary index
 
From:   John Hall

I don't think that the re-ordering of the index columns is documented anywhere public (other than what you'll find on the TeradataForum - a blatant plug). So here's my spin:

Although the statement that created the table is kept in DBC.TVM, it's not used by the SHOW TABLE command. The SHOW TABLE re-constructs the table statement based on the information contained in the Data Dictionary (starting with tables DBC.TVM, DBC.TVFIELDS and DBC.INDEXES) and the Table Header for that table (which can't be viewed, but contain things like set/multiset, freespace, blocksize). This was in a couple of previous threads:

www.teradataforum.com/teradata/20011129_115635.htm

and

www.teradataforum.com/teradata/20011129_033617.htm

The reason that the SHOW TABLE re-constructs the table definition is historical. I'm not completely sure, but I don't believe that columns like CREATETEXT and REQUESTTEXT existed on the first couple of releases of TOS (talking about V1R1, V1R2 in the early 1980's - yep, been around since V1R3 was in beta testing).

To implement the SHOW TABLE, the table definition had to be re-constructed from the Data Dictionary. By the time those columns were added, there was already an installed customer-base and it was necessary to continue this re-construction to maintain backward compatibility.

Why are the index columns put in alphabetical order? Who knows? Probably depends on whether the programmer went to Sonny's for lunch or maybe more likely, how the table DBC.TVFIELDS and DBC.INDEXES was accessed by the programmer. As you mentioned, since column order doesn't matter, it wasn't necessary to maintain the order for the SHOW TABLE.



     
  <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