Tuesday, August 7, 2012
Finding/Retrieving CPU cycles in Teradata
The usual causes for a frequently sumbitted SQL to take longer than usual to respond are
(a). The user's session may have been blocked or delayed.
(b). The system may have been busier than usual.
(c). The volume of data the SQL deals with may have increased.
One source I know of retrieving cpu cycles is from DBC.DQLOGTBL. It has log of all the queries run on TD system.
Below are the some of useful columns
collecttimestamp -- timestamp
SESSIONID --- useful if there are multiple sessions for a request
USERNAME --
LOGONSOURCE --- logon source will be unique for each request ( one request could have multiple sessions. So grouping by this will give the cpu for each request by the user at the same time. process number ( i know for unix) would be captured in the logon string)
For more details click this link
http://developer.teradata.com/doc/connectivity/tdnetdp/13.11/webhelp/LogonSourceFormat.html
AMPCPUTIME -- cpu cycles consumed by each query
TotalIOCount
RequestNum -- query sequence of all teh queries in the request.
StartTime
FirstStepTime
FirstRespTime
QueryText
StatementType
StatementGroup
-->simple query for calc cpu
Select *
from dbc.qrylog
where username = 'xxx'
and cast(starttime as date) = date;
---> I think
delayed time = starttime - firststepTime
execution time = firstStepTime - FirstResponseTime
Let me know if I have made some wrong assumptions above.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment