Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

Space in the database - response (15) by elanir2012

$
0
0

hi Rajeev,
 
i dont know about the DB level but for table level use this:
 

SELECT databasename

 

, tablename

 

, MAX(CurrentPerm) * (HASHAMP()+1)/1024/1024/1024 AS Current_Perm

 

, cast (cast (max (currentperm)*(hashamp()+1) AS float) /

 

cast (1024*1024*1024 AS float) AS decimal(18,2)) AS Effective_Perm_Including_Skew

 

, Effective_Perm_Including_Skew - Current_Perm AS Space_Wasted_Due_To_Skew

 

, (100 - (avg (CurrentPerm) / NULLIFZERO(max (CurrentPerm))*100)) AS Skew_Percent

 

FROM dbc.tablesize ts

 

WHERE databasename = 'name of DB'

 

GROUP by 1,2

 

ORDER BY 5 DESC
 
 


Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>