Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 28 Jun 2001 @ 20:09:44 GMT


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


Subj:   Re: Statistics about table statistics
 
From:   Rajiv Devulapalli

Run this SQL. You may need to add more columns to it as needed.

     -- column level stats.
     Select distinct 'Collect Statistics on ',
     trim(dbase.databasenamei)||'.'||
     trim(tvm.tvmnameI) tblname, ' column ', tvf.fieldname, ' ;' from
     dbc.tvfields
     tvf , dbc.tvm tvm, dbc.dbase
     where tvf.tableid = tvm.tvmid and tvf.fieldstatistics is not null
     and tvm.databaseid = dbase.databaseid
     and dbase.databasenamei = 'dbatlas'
     UNION
     -- index level stats.
     select distinct 'Collect Statistics on ',
     trim(dbase.databasenamei)||'.'||
     trim(tvm.tvmnameI) tblname, ' index ', ind.name, ' ;'
     from dbc.indexes ind , dbc.tvm tvm
     where ind.tableid = tvm.tvmid
     and ind.indexstatistics is not null
     and tvm.databaseid = dbase.databaseid
     and dbase.databasenamei = 'your_db_name'
     order by 2, 3 ;


     
  <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