All Forums Database
vc 4 posts Joined 05/16
06 Sep 2016
Find skew with perm over 1gb

Hello,
I am using the below query 

SELECT 

cast(DatabaseName as char(30)),

cast(Tablename as char(40)),

(100 - (AVG(CURRENTPERM)/MAX(CURRENTPERM)*100) (FORMAT 'zz9.99') )AS Skewfactor_greater_90,

cast (CURRENT_date as timestamp(0)) + ((current_time -time '00:00:00') hour to second(0)) As AS_ON

FROM 

DBC.TABLESIZEV 

where  DATABASENAME like ('prstn%')

having Skewfactor_greater_90 >=90

GROUP BY 1,2

Order by 1,3;

 

As the query is finding and calculating skew in term od percentage  and displaying the ones greater than 90

 

How can  we find  the skew with perm over 1 GB????

AtardecerR0j0 71 posts Joined 09/12
07 Sep 2016

SELECT 
  cast(DatabaseName as char(30)),
  cast(Tablename as char(40)),
  (100 - (AVG(CURRENTPERM)/MAX(CURRENTPERM)*100) (FORMAT 'zz9.99') )AS Skewfactor_greater_90,
  cast (CURRENT_date as timestamp(0)) + ((current_time -time '00:00:00') hour to second(0)) As AS_ON
FROM DBC.TABLESIZEV 
where  DATABASENAME like ('prstn%')
having Skewfactor_greater_90 >=90
  and sum(CURRENTPERM)>1024*1024*1024
GROUP BY 1,2
Order by 1,3;

 

Be More!!

You must sign in to leave a comment.