O'Reilly logo

Teradata Cookbook by Rajsekhar Bhamidipati, Abhinav Khandelwal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

  1. Connect to Teradata using SQLA or Studio.
  2. Find the size of tables in the system using the following query. The output will contain databasename, tablename, and the size of the table with skew; it can be seen in the following code:
/*Find table size*/SELECT  B.databasename , B.TableName , SUM ( currentperm ) ( NAMED CurrentPerm ) ,MAXIMUM ( currentperm ) ( NAMED MaxPerm ) , AVG ( currentperm ) ( NAMED AvgPerm ) ,( ( MAXIMUM ( currentperm ) - AVG ( currentperm )  ) * 100.0  ) / ( MAXIMUM ( currentperm )  ) ( NAMED SkewPercent ) 
FROM    dbc.tablesize B INNER JOIN DBC.TABLES A 
    ON  A.DATABASENAME = B.DATABASENAME 
    AND A.TABLENAME = B.TABLENAME 
GROUP   BY 1 , 2 
ORDER   BY 1 , 2 ;

Following is the output of the query.

  1. Based on the size of ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required