About the DBC.AMPUsage View
The DBC.AMPUsage view provides information about the usage of each AMP for each user and account. It also tracks the activities of any console utilities. By user, account, or console utility session, DBC.AMPUsage stores information about:
Note: AMPUsage reports logical I/Os explicitly requested by the database software, even if the requested segment is in cache and no physical I/O is performed.
DBC.AMPUsage uses the DBC.Acctg table to provide aggregated information by username, account ID, and AMP. Updates to the table are made periodically during each AMP step on each processor affected by the step. (This means if there are long-running steps, AMPUsage numbers show large increases periodically, instead of continuous incremental additions.) The data is collected and continually added to what is already in the table until you reset the counters to zero (see “Resetting the Resource Usage Counters” on page 157).
You can use the information provided by DBC.AMPUsage to do the following:
DBC.AmpUsage does not record the activity of parsing the query, or of processing on a query basis.
You can use query logging to capture query text, step information, and elapsed processing time, and to differentiate queries submitted by SQL-generating products that do not provide a variety of user IDs and account ids in the logon string. For instructions and a description of the data capture options, see Chapter 15: “Tracking Query Behavior with Database Query Logging: Operational DBAs.”
Use Teradata Viewpoint for a look at up-to-the-moment activity in real-time.
Example : Totalling CPU Time and I/O by User
This SQL statement requests totals for CPU time and I/O for user DBA01.
The totals are aggregates of all resources.
SELECT UserName (FORMAT 'X (16)')
,AccountName (FORMAT 'X (12)')
,SUM (CpuTime)
,SUM (DiskIO)
FROM DBC.AMPUsage
WHERE UserName = 'DBA01'
GROUP BY 1, 2
ORDER BY 3 DESC ;
For this example, AMPUsage returns the following rows:
UserName
--------
DBA01
DBA01
DBA01
|
AccountName
-----------
$M2$ABCD&S&D&H
$M2$EFGH&S&D&H
$M2$IJKL&S&D&H
|
SUM (CpuTime)
-------------
6,336.76
4,387.14
1.28
|
SUM (DiskIO)
-----------
505,636
303,733
166
|
For detailed information on these and all the system views, see Data Dictionary. For more information on how to use DBC.AMPUsage and other views to find problems and improve performance, see “ASE Impact on PE and AMP Performance” on page 510.