30.06.2013 Views

Performance Tuning with SQL Server Dynamic Management Views

Performance Tuning with SQL Server Dynamic Management Views

Performance Tuning with SQL Server Dynamic Management Views

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 5: Indexing Strategy and Maintenance<br />

AND ddius.[object_id] = ddios.[object_id]<br />

AND SP.[partition_number] = ddios.[partition_number]<br />

AND ddius.[database_id] = ddios.[database_id]<br />

WHERE OBJECTPROPERTY(ddius.[object_id], 'IsUserTable') = 1<br />

AND ddius.[index_id] > 0<br />

AND ddius.[user_seeks] + ddius.[user_scans] + ddius.[user_lookups] = 0<br />

ORDER BY ddius.[user_updates] DESC ,<br />

su.[name] ,<br />

o.[name] ,<br />

i.[name ]<br />

Listing 5.8: Detailed write information for unused indexes.<br />

Upon review of the output it's quite clear that some of these indexes are still being<br />

hammered by inserts even though the users are not benefiting from their existence in<br />

regard to reads. If I encountered metadata like this in the real world (wink, wink) you<br />

could be sure that I would do something about it.<br />

193

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!