Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How Can You Find Out If An Index Is Being Used Or Not In SQL Server?

Posted on 2011-03-01
6
Medium Priority
?
269 Views
Last Modified: 2012-05-11
Is there a way to detect and or gather information that show what indexes are being used and how often the are being used in a SQL Server database?
0
Comment
Question by:Omega002
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 8

Expert Comment

by:Forefront_Data_Solutions
ID: 35012379
If you are using SQL Server 2005 or later, there are some useful queries you can use.  Check these out:
http://www.mssqltips.com/tip.asp?tip=1239
0
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 2000 total points
ID: 35012430
if you haven't restarted your system for a while the following script will list out the indexes, you have to monitor them for few days bbefore you delete

 SELECT   * FROM      sys.indexes idx          JOIN      sys.dm_db_index_usage_stats ius ON idx.object_id = ius.object_id                                                       AND idx.index_id = ius.index_id          WHERE     idx.type_desc = 'nonclustered'                    AND ius.user_seeks = ( SELECT   MAX(user_seeks)                                           FROM     sys.dm_db_index_usage_stats                                           WHERE    object_id = ius.object_id                                                    AND type_desc = 'nonclustered' )      
0
 
LVL 41

Expert Comment

by:Sharath
ID: 35012535
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Omega002
ID: 35096339
can I also see this over a period of time like for the last 3 months?
0
 

Author Comment

by:Omega002
ID: 35166274
Is there a way to capture Index usage in SQL Server Over a daily, weekly, monthly and quarterly period?
0
 
LVL 41

Expert Comment

by:Sharath
ID: 35168803
No, you cannot. On a regular basis, if you can save the result of the query mentioned in the URL  to a temp table, you can have the history.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question