How to do it...

  1. Pick the database on which you need to analyze the skew tables.
  2. Execute this query to get the list of tables:
/**Skew table in a database query**/Lock Dbc.TableSize For Access Lock Dbc.tables For Access SELECT B.databasename , B.TableName , A.LastAccessTimeStAMP , 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 WHERE B.DATABASENAME = <my_database>GROUP BY 1 , 2 , 3 HAVING ( ( MAXIMUM ( currentperm ) - AVG ( currentperm ) ...

Get Teradata Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.