Thursday, 26 June 2014

Query to find Skew factor of particular table

  1. SELECT
  2. TABLENAME,
  3. SUM(CURRENTPERM) /(1024*1024) AS CURRENTPERM,
  4. (100 - (AVG(CURRENTPERM)/MAX(CURRENTPERM)*100)) AS SKEWFACTOR
  5. FROM
  6. DBC.TABLESIZE
  7. WHERE DATABASENAME= <DATABASENAME>
  8. AND
  9. TABLENAME =<TABLENAME>
  10. GROUP BY 1;

No comments:

Post a Comment