Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 13 Dec 2011 @ 07:47:18 GMT


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


Subj:   Re: Tables which don't have stats
 
From:   Yong Boon

Sravan,

This is the query to identify table that does not have any stats defined on column/index associated with.

     SELECT a.databasename
            , a.tablename
        FROM dbc.tables a
        LEFT OUTER JOIN (  SELECT databasename
                                  , tablename
                             FROM dbc.ColumnStats
                         GROUP BY 1, 2
                         UNION ALL
                           SELECT databasename
                                  , tablename
                             FROM dbc.IndexStats
                         GROUP BY 1, 2
                           UNION ALL
                           SELECT databasename
                                  , tablename
                             FROM dbc.MultiColumnStats
                         GROUP BY 1, 2) b
                     ON a.databasename = b.databasename
                    AND a.tablename = b.tablename
        WHERE b.databasename IS NULL

Regards,

YB



     
  <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