Queries to identify sessions having high AMP CPU and IO Skew in Teradata

# Amp Cpu Skew

SEL UserName (TITLE 'Users', format 'X(20)'),

SessionNo (TITLE 'Session', FORMAT 'Z(9)ZZZ'),

(100 * (1 - (AvgAmpCpuSec / NULLIFZERO(HotAmp1Cpu))))

(TITLE 'Amp CPU Skew %',FORMAT 'ZZ9')

FROM TABLE (SYSLIB.MonitorSession(-1,'*',0)) AS t1

WHERE AmpState='ACTIVE' AND HotAmp1Cpu > 0

ORDER BY 1,2;

# Amp IO Skew

SEL UserName (TITLE 'Users', format 'X(20)'),

SessionNo (TITLE 'Session', FORMAT 'Z(9)ZZZ'),

(100 * (1 - (AvgAmpIOCnt / NULLIFZERO(HotAmp1IO))))

(TITLE 'Amp IO Skew %',FORMAT 'ZZ9')

FROM TABLE (SYSLIB.MonitorSession(-1,'*',0)) AS t1

WHERE AmpState='ACTIVE' AND HotAmp1IO > 0

ORDER BY 1,2;