Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 16 Mar 2006 @ 17:46:23 GMT


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


Subj:   Re: Identifying Large NUSI ?
 
From:   Dye, Lisa

Try this:

     SELECT
        SUM(a.CurrentPerm)
       ,b.DataBaseName
       ,b.TableName
       ,b.ColumnName
     FROM
        DBC.TableSize a, DBC.Indices b
     WHERE
        a.DatabaseName = b.DataBaseName
     AND
        a.TableName    = b.TableName
     AND
        b.IndexType = 'S'
     AND
        b.UniqueFlag = 'N'
     GROUP BY
        b.DataBaseName
       ,b.TableName
       ,b.ColumnName
     ORDER BY
        SUM(A.CurrentPerm) DESC
       ,b.ColumnName ASC
       ,b.TableName ASC
       ,b.DataBaseName ASC
     ;


     
  <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