PerformanceCollector.PlanCacheMetrics.sql 1.01 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
PRINT '-----------------------------------------------------------------------------------------------------------------'
PRINT '-- PerformanceCollector.PlanCacheMetrics '
PRINT '-----------------------------------------------------------------------------------------------------------------'
IF OBJECT_ID('PerformanceCollector.PlanCacheMetrics') IS NULL
BEGIN 
  Create table PerformanceCollector.PlanCacheMetrics
  ( CurrTime datetime
  , ServerName varchar(200)
  , DBName varchar(200)
  , SPName varchar(200)
  , ExecutionCount bigint
  , CallsPerSecond bigint
  , TotalWorkerTime bigint
  , TotalElapsedTime bigint
  , AvgElapsedTime bigint
  , AvgWorkerTime bigint
  , TotalLogicalReads bigint
  , AvgLogicalReads bigint
  , TotalPhysicalReads bigint
  , AvgPhysicalReads bigint
  , TotalLogicalWrites bigint
  , AvgLogicalWrites bigint
  , CachedTime datetime
  , RowNumber int
  , Metric varchar(200)
  )
END
ELSE BEGIN
	Print 'Table already exists, performing Alters (if required)...'
END
GO