Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Space in the database - response (16) by mapsiddiqui

$
0
0

Hi elanir2012,
 
I believe your query should look like this:

SELECT

  DATABASENAME

, TABLENAME

, SUM(CURRENTPERM)/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 = 'XYZ'

GROUP BY 1,2

ORDER BY 6 DESC

 

changed the expression for current_perm.

 

Thanks,

-Anjum.


Viewing all articles
Browse latest Browse all 14773

Trending Articles



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