Databases Reference
In-Depth Information
Figure 10-10
The technique used in the query to truncate the textData column to an arbitrary length (25, in the query
below) may not be perfect for complex user transactions. It will require sophisticated logic to identify and
group user transactions accurately; the Read80Trace utility is an example. See the article ''Description of
the SQL Server Performance Analysis Utilities Read80Trace'' at http://support.microsoft.com/
kb/887057 .
SELECT
SUBSTRING(textData, 1, 25) AS TextData,
COUNT(*) AS EventCount,
AVG(cpu) AS Average_CPU,
AVG(reads) AS Average_Reads,
AVG(writes) AS Average_Writes,
SUM(cpu) AS Sum_CPU,
SUM(reads) AS Sum_Reads,
SUM(writes) AS Sum_Writes,
MAX(cpu) AS Max_CPU,
MAX(reads) AS Max_Reads,
MAX(writes) AS Max_Writes
FROM fn_trace_gettable('c: \ Temp \ DS2_40Threads_20Min_3SecThink.trc', default)
--FROM dbo.DS2_40Threads_20Min_3SecThink
WHERE eventclass IN (10,12)
GROUP BY SUBSTRING(textData, 1, 25)
ORDER BY Average_CPU DESC
Search WWH ::




Custom Search