Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 28 Jan 2008 @ 14:14:56 GMT


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


Subj:   Re: Help (on Stats)
 
From:   David Clough

Thanks for the contributions about Stats.

Just for feedback, in the end I opted for the following approach:

Derive a string of Primary Index columns using a Cursor on,

     SELECT ColumnName AS TAB_COL FROM dbc.Indices IN1
                      WHERE        databaseName = ':IN_DB' AND TABLENAME = ':IN_TB'
                      AND        IN1.IndexType = 'P'
                      ORDER BY IN1.ColumnPosition    ;

This, with a bit of concatenation, gives me something like 'COL1,COL2,COL3'

I then used the Help Statistics on the TABLE, grabbing the output and checking whether the first column (which is the actual table column) equals the generated string. If it does then I've got the Stats for the Primary Index.

Why did I do it this way ? Mainly because HELP STATISTICS MyTable index (indexColumn1 [, indexCOlumn2]); is frustratingly slow, and at least the Stats provided for by the basic "HELP STATISTICS MyTable" gives exactly the output I want - and it's fast.

Dave Clough
Database Designer
Express ICS

www.tnt.com



     
  <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