<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>What is the difference between sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats?</title><link>http://blogs.msdn.com/craigfr/archive/2008/10/30/what-is-the-difference-between-sys-dm-db-index-usage-stats-and-sys-dm-db-index-operational-stats.aspx</link><description>SQL Server includes two DMVs - sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats - that are extremely useful for monitoring which indexes are used as well as how and when they are used. Both DMVs report similar statistics on information</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: What is the difference between sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats?</title><link>http://blogs.msdn.com/craigfr/archive/2008/10/30/what-is-the-difference-between-sys-dm-db-index-usage-stats-and-sys-dm-db-index-operational-stats.aspx#9037200</link><pubDate>Tue, 04 Nov 2008 07:28:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9037200</guid><dc:creator>Uri Dimant</dc:creator><description>&lt;p&gt;Hello Craig&lt;/p&gt;
&lt;p&gt;It is very useful post. I use SQL Server 2005 &amp;nbsp;and looking at sys.dm_db_index_operational_stats&lt;/p&gt;
&lt;p&gt;DMV to get the info about one of my table I get more than 20 rows , something like that index=2&lt;/p&gt;
&lt;p&gt;index_id,range_scan_count,singleton_lookup_count&lt;/p&gt;
&lt;p&gt;2	1	90&lt;/p&gt;
&lt;p&gt;2	1	2&lt;/p&gt;
&lt;p&gt;2	0	9&lt;/p&gt;
&lt;p&gt;2	0	0&lt;/p&gt;
&lt;p&gt;2	4	0&lt;/p&gt;
&lt;p&gt;2	1	0&lt;/p&gt;
&lt;p&gt;2	0	0&lt;/p&gt;
&lt;p&gt;2	0	0&lt;/p&gt;
&lt;p&gt;2	25	39&lt;/p&gt;
&lt;p&gt;2	790	1&lt;/p&gt;
&lt;p&gt;2	32779	42&lt;/p&gt;
&lt;p&gt;How do I know that index=2 is useful? Why do I have lots of rows for index=2. The above output seems that I have lots of ranges and less singleton_lookup_count which means that I need to examine this &amp;nbsp;index ,right?&lt;/p&gt;
&lt;p&gt;Than you&lt;/p&gt;
</description></item><item><title>re: What is the difference between sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats?</title><link>http://blogs.msdn.com/craigfr/archive/2008/10/30/what-is-the-difference-between-sys-dm-db-index-usage-stats-and-sys-dm-db-index-operational-stats.aspx#9044797</link><pubDate>Wed, 05 Nov 2008 20:43:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9044797</guid><dc:creator>craigfr</dc:creator><description>&lt;p&gt;I can think of two reasons why you might see multiple rows for index_id 2. &amp;nbsp;First, if you use the OBJECT_ID function but it fails, it may return NULL which would cause the DMV to return rows for all objects. &amp;nbsp;Second, if you have a partitioned table, you will get one row per partition. &amp;nbsp;Try selecting the database_id, ojbect_id, and partition_number columns from the DMV to get more information about these rows.&lt;/p&gt;
</description></item><item><title>re: What is the difference between sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats?</title><link>http://blogs.msdn.com/craigfr/archive/2008/10/30/what-is-the-difference-between-sys-dm-db-index-usage-stats-and-sys-dm-db-index-operational-stats.aspx#9047075</link><pubDate>Thu, 06 Nov 2008 08:48:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9047075</guid><dc:creator>Uri Dimant</dc:creator><description>&lt;p&gt;Hello Craig&lt;/p&gt;
&lt;p&gt;Yes &amp;nbsp;you are right.OBJECT_ID function fails and returns NULL.I do not have partitioned &amp;nbsp;table hence it returns 1 for partition_number column.&lt;/p&gt;
&lt;p&gt;But why OBJECT_ID has been failed, and one more question if have a large number for then range_scan_count and 0 for singleton_lookup_count does that mean the index is unuseful/needed to be tracked down, am I right?&lt;/p&gt;
</description></item><item><title>re: What is the difference between sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats?</title><link>http://blogs.msdn.com/craigfr/archive/2008/10/30/what-is-the-difference-between-sys-dm-db-index-usage-stats-and-sys-dm-db-index-operational-stats.aspx#9051173</link><pubDate>Fri, 07 Nov 2008 04:34:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9051173</guid><dc:creator>craigfr</dc:creator><description>&lt;p&gt;OBJECT_ID could fail for many reasons. &amp;nbsp;If you have not already, try specifying the full three part name for the object and make sure if you have a case sensitive collation that you spelled the entire name correctly.&lt;/p&gt;
&lt;p&gt;If either range_scan_count or singleton_lookup_count is non-zero, the index is being used. &amp;nbsp;Moreover, as I noted in my post, even if both fields are zero, you still need to check sys.dm_db_index_usage_stats before you drop the index.&lt;/p&gt;
</description></item></channel></rss>