Advertisement
bytecoded

Cost of Missing Indexes

Oct 29th, 2019
530
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.72 KB | None | 0 0
  1. SELECT
  2.     [Total Cost] = ROUND(avg_total_user_cost * avg_user_impact * (user_seeks + user_scans), 0),
  3.     avg_user_impact,
  4.     TableName = statement,
  5.     [EqualityUsage] = equality_columns,
  6.     [InequalityUsage] = inequality_columns,
  7.     [Include COLUMNS] = included_columns
  8.    
  9. FROM sys.dm_db_missing_index_groups g
  10.  
  11.     INNER JOIN sys.dm_db_missing_index_group_stats s
  12.     ON s.group_handle = g.index_group_handle
  13.  
  14.     INNER JOIN sys.dm_db_missing_index_details d
  15.     ON d.index_handle = g.index_handle
  16.    
  17. WHERE
  18.     statement LIKE '%AccRgED636%'
  19.     OR statement LIKE '%AccRg614%'
  20.     OR statement LIKE '%InfoRg9712%'
  21.     OR statement LIKE '%AccumRg10678%'
  22.     OR statement LIKE '%AccumRg11289%'
  23.  
  24. ORDER BY [Total Cost] DESC;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement