SQL Server 2005 DMV - how it can help to consider whether index is useful or not?

Published 04 February 08 07:06 AM | SQL Master 

When it comes to performance, for a DBA indexes are the first one to come to mind in order to fine tune the tasks on the database.

In this series we have already covered this huge topic of indexing and how best you can make use of Dynamic Management Views within SQL Server 2005 version that was lacking in previous versions. The following blog posts covers much of this topic:

SQL Server 2005 methods to find table INDEX or Statistics age for better performance

DMVs to provide state of TEMPDB during a performance tuning analysis

SQL Server indexing - when to reorganize or rebuild?

Guidelines for enabling indexes and online index operations 

Unused indexes on a database, its good and bad 

Right on this huge topic for a DBA taking a decision of whether a new index or modifying current index would help any gain in the performance or not is typical. For every performance if the object statistics are poor then impact of running slow is highly-possible SQL Server dynamic management views have a set of DMVs which provide excellent and detailed information for object usage. To know more whether any usefulness in adding new index then run the following query, this is find potential indexes:


select d.*, s.avg_total_user_cost , s.avg_user_impact, s.last_user_seek
,s.unique_compiles

from
sys.dm_db_missing_index_group_stats s ,sys.dm_db_missing_index_groups g
,sys.dm_db_missing_index_details d

where s.group_handle = g.index_group_handle and d.index_handle = g.index_handle
order
by s.avg_user_impact desc
go

The result would encompass where the index will be beneficial that will help the performance, bear in mind the DMV will return the state since the last restart of that SQL Server instance. Based on the result and timing on availability for maintenance window you must decide whether this is required or not. The usefulness of blogs are give suggestion and best follower is to test that suggestion within their environment to prove it works or not.

 

Comments

# SSQA.net - SqlServer-QA.net said on February 4, 2008 7:27 AM:

When it comes to performance, for a DBA indexes are the first one to come to mind in order to fine tune

# Other SQL Server Blogs around the Web said on February 4, 2008 8:30 AM:

When it comes to performance, for a DBA indexes are the first one to come to mind in order to fine tune

# TrackBack said on February 7, 2008 12:57 AM:
# TrackBack said on February 7, 2008 12:57 AM:
Anonymous comments are disabled

About SQL Master

**__________________________________** SQL Server MVP, Sr. DBA & industry expert. - Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it. It is also a power and you will gain by sharing it.