<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: June Question: What is your best advice for boosting index performance?</title>
	<atom:link href="http://www.bradmcgehee.com/2010/06/june-question-what-is-your-best-advice-for-boosting-index-performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bradmcgehee.com/2010/06/june-question-what-is-your-best-advice-for-boosting-index-performance/</link>
	<description>Brad M. McGehee, Director of DBA Education, Red Gate Software</description>
	<lastBuildDate>Mon, 06 Feb 2012 20:24:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: bradmcgehee</title>
		<link>http://www.bradmcgehee.com/2010/06/june-question-what-is-your-best-advice-for-boosting-index-performance/#comment-692</link>
		<dc:creator>bradmcgehee</dc:creator>
		<pubDate>Thu, 01 Jul 2010 17:26:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.bradmcgehee.com/?p=1577#comment-692</guid>
		<description>This contest is over, and the winner will be announced soon.</description>
		<content:encoded><![CDATA[<p>This contest is over, and the winner will be announced soon.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: IJeb Reitsma</title>
		<link>http://www.bradmcgehee.com/2010/06/june-question-what-is-your-best-advice-for-boosting-index-performance/#comment-687</link>
		<dc:creator>IJeb Reitsma</dc:creator>
		<pubDate>Thu, 01 Jul 2010 05:47:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.bradmcgehee.com/?p=1577#comment-687</guid>
		<description>Determine the queries of the overall workload that cause the most logical reads. Create (covering) indexes for those queries if necessary.

The top queries can be determined with traces or from DMO sys.dm_exec_query_stats.

Check the improvement of each individual query.</description>
		<content:encoded><![CDATA[<p>Determine the queries of the overall workload that cause the most logical reads. Create (covering) indexes for those queries if necessary.</p>
<p>The top queries can be determined with traces or from DMO sys.dm_exec_query_stats.</p>
<p>Check the improvement of each individual query.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josef Richberg</title>
		<link>http://www.bradmcgehee.com/2010/06/june-question-what-is-your-best-advice-for-boosting-index-performance/#comment-674</link>
		<dc:creator>Josef Richberg</dc:creator>
		<pubDate>Mon, 28 Jun 2010 20:13:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.bradmcgehee.com/?p=1577#comment-674</guid>
		<description>Use unique indexes wherever possible as you can cheat with statistics.  If you have a unique index (clustered or not), say the columns are A,B,C, and you always provide all 3 columns, statistics are moot FOR THAT COMBINATION.  SQL Server knows that you will only ever get one row for that combination.  This is powerful, but can cause issues if you use anything less than the unique combination.  I tend to use this for permanent temp tables and tables within stored procedures.</description>
		<content:encoded><![CDATA[<p>Use unique indexes wherever possible as you can cheat with statistics.  If you have a unique index (clustered or not), say the columns are A,B,C, and you always provide all 3 columns, statistics are moot FOR THAT COMBINATION.  SQL Server knows that you will only ever get one row for that combination.  This is powerful, but can cause issues if you use anything less than the unique combination.  I tend to use this for permanent temp tables and tables within stored procedures.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amy</title>
		<link>http://www.bradmcgehee.com/2010/06/june-question-what-is-your-best-advice-for-boosting-index-performance/#comment-616</link>
		<dc:creator>Amy</dc:creator>
		<pubDate>Wed, 16 Jun 2010 17:12:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.bradmcgehee.com/?p=1577#comment-616</guid>
		<description>Check fragmentation and reindex/reorganize regularly.

Make sure the Fill Factor is appropriate for the index.

Make sure all indexes are actually useful.  I&#039;ve seen people add 1 index for each column, even if the selectivity is low, and they rarely query that column.  Too many indexes on a table with a lot of modifications is not good.  In an OLTP database, you need to be more selective on the indexes you add.</description>
		<content:encoded><![CDATA[<p>Check fragmentation and reindex/reorganize regularly.</p>
<p>Make sure the Fill Factor is appropriate for the index.</p>
<p>Make sure all indexes are actually useful.  I&#8217;ve seen people add 1 index for each column, even if the selectivity is low, and they rarely query that column.  Too many indexes on a table with a lot of modifications is not good.  In an OLTP database, you need to be more selective on the indexes you add.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevan Riley</title>
		<link>http://www.bradmcgehee.com/2010/06/june-question-what-is-your-best-advice-for-boosting-index-performance/#comment-613</link>
		<dc:creator>Kevan Riley</dc:creator>
		<pubDate>Wed, 16 Jun 2010 09:40:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.bradmcgehee.com/?p=1577#comment-613</guid>
		<description>One area often overlooked is that of unused indexes.

Unused indexes are a performance lag when it comes to modifying data; each index that is affected by updates/deletes/inserts will have to be rebuilt.

Luckily we have a DMV that can help us - sys.dm_db_index_usage_stats

From this DMV we can get an understanding of the &quot;hits&quot; an index gets, i.e. how many times it has been used, by summing (user_seeks + user-scans + user_lookups), vs the &quot;updates&quot; (user_updates)

An index that has many &quot;updates&quot; but few &quot;hits&quot;, may be one for review.  I say &quot;may&quot;, as you would still have to ensure that it wasn&#039;t that one critical index that is used for year-end reporting, and you would have to decide whether it was better to create the index for the time it was required, and then drop it ; or keep the index as-is.</description>
		<content:encoded><![CDATA[<p>One area often overlooked is that of unused indexes.</p>
<p>Unused indexes are a performance lag when it comes to modifying data; each index that is affected by updates/deletes/inserts will have to be rebuilt.</p>
<p>Luckily we have a DMV that can help us &#8211; sys.dm_db_index_usage_stats</p>
<p>From this DMV we can get an understanding of the &#8220;hits&#8221; an index gets, i.e. how many times it has been used, by summing (user_seeks + user-scans + user_lookups), vs the &#8220;updates&#8221; (user_updates)</p>
<p>An index that has many &#8220;updates&#8221; but few &#8220;hits&#8221;, may be one for review.  I say &#8220;may&#8221;, as you would still have to ensure that it wasn&#8217;t that one critical index that is used for year-end reporting, and you would have to decide whether it was better to create the index for the time it was required, and then drop it ; or keep the index as-is.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rowland G</title>
		<link>http://www.bradmcgehee.com/2010/06/june-question-what-is-your-best-advice-for-boosting-index-performance/#comment-608</link>
		<dc:creator>Rowland G</dc:creator>
		<pubDate>Mon, 14 Jun 2010 14:07:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.bradmcgehee.com/?p=1577#comment-608</guid>
		<description>First, do no harm ;) I think the best performance comes by way of testing. Hopefully you&#039;re on SQL 2005 or higher where you can get some useful guidance from the DMVs.

Too often I see junior level folks willing to create an index without much regard to actual need. Workloads change, servers change, needs change--it&#039;s good to look at this from a routine maintenance perspective like mowing the grass. 

Using the following DMVs figure out what&#039;s going on. Here are a few of my faves:

1) sys.dm_db_index_usage_stats
2) sys.dm_db_missing_index_details
3) sys.dm_db_missing_index_groups 
4) sys.dm_db_missing_index_group_stats

These joined back to sys.indexes and other tables can give pretty good insight into what actions to take.

Once the evidence has been gathered on what needs to be done, then gradually add the changes and revisit the above DMVs to be sure you&#039;ve gotten it right.

Rinse and Repeat.</description>
		<content:encoded><![CDATA[<p>First, do no harm <img src='http://www.bradmcgehee.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  I think the best performance comes by way of testing. Hopefully you&#8217;re on SQL 2005 or higher where you can get some useful guidance from the DMVs.</p>
<p>Too often I see junior level folks willing to create an index without much regard to actual need. Workloads change, servers change, needs change&#8211;it&#8217;s good to look at this from a routine maintenance perspective like mowing the grass. </p>
<p>Using the following DMVs figure out what&#8217;s going on. Here are a few of my faves:</p>
<p>1) sys.dm_db_index_usage_stats<br />
2) sys.dm_db_missing_index_details<br />
3) sys.dm_db_missing_index_groups<br />
4) sys.dm_db_missing_index_group_stats</p>
<p>These joined back to sys.indexes and other tables can give pretty good insight into what actions to take.</p>
<p>Once the evidence has been gathered on what needs to be done, then gradually add the changes and revisit the above DMVs to be sure you&#8217;ve gotten it right.</p>
<p>Rinse and Repeat.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob Hovious</title>
		<link>http://www.bradmcgehee.com/2010/06/june-question-what-is-your-best-advice-for-boosting-index-performance/#comment-607</link>
		<dc:creator>Bob Hovious</dc:creator>
		<pubDate>Mon, 14 Jun 2010 13:09:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.bradmcgehee.com/?p=1577#comment-607</guid>
		<description>1.   First and foremost is to make sure you have covering indexes available to support all high-volume, high-performance query, so that all columns can be drawn from the index without having to do a lookup from the primary table.   

2.  Pay attention to the sequence of the columns.   Vital statistics are kept on the distribution of values within the first column of the index, and somewhat lesser information is kept on values in the second column.    If you find your queries doing a lot of index scans instead of index seeks, even a covering index will run slowly. 

2.  Where all columns can&#039;t be included due to disk space constraints or other maintenance reasons, try to at least keep an index that covers all the columns for in the queries&#039;  JOINs or WHERE clauses.


3.  Consider partitioning indexes over large tables.    I have a general rule of thumb that if the table is large enough to partition, so is an index over that table.

4.  Use the new filtered index functionality where appropriate.   If you can filter out most of the rows in the table at the index level prior to a query it can be a boost.    But be sure to test your queries to make sure they actually  use the filtered index.

5.  Don&#039;t forget about indexed views.    If you can afford the disk space and maintenance overhead, they can take the JOIN load away.

6.  Last but not least, pay careful attention to the sort order of the indexes.    If there is a usual ORDER BY order in which queries are run (for example:  region/customer/sales date descending), then having an index already in that sequence can give you the sort for &quot;free&quot; at query runtime, which can be a major boost to speed.</description>
		<content:encoded><![CDATA[<p>1.   First and foremost is to make sure you have covering indexes available to support all high-volume, high-performance query, so that all columns can be drawn from the index without having to do a lookup from the primary table.   </p>
<p>2.  Pay attention to the sequence of the columns.   Vital statistics are kept on the distribution of values within the first column of the index, and somewhat lesser information is kept on values in the second column.    If you find your queries doing a lot of index scans instead of index seeks, even a covering index will run slowly. </p>
<p>2.  Where all columns can&#8217;t be included due to disk space constraints or other maintenance reasons, try to at least keep an index that covers all the columns for in the queries&#8217;  JOINs or WHERE clauses.</p>
<p>3.  Consider partitioning indexes over large tables.    I have a general rule of thumb that if the table is large enough to partition, so is an index over that table.</p>
<p>4.  Use the new filtered index functionality where appropriate.   If you can filter out most of the rows in the table at the index level prior to a query it can be a boost.    But be sure to test your queries to make sure they actually  use the filtered index.</p>
<p>5.  Don&#8217;t forget about indexed views.    If you can afford the disk space and maintenance overhead, they can take the JOIN load away.</p>
<p>6.  Last but not least, pay careful attention to the sort order of the indexes.    If there is a usual ORDER BY order in which queries are run (for example:  region/customer/sales date descending), then having an index already in that sequence can give you the sort for &#8220;free&#8221; at query runtime, which can be a major boost to speed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shankar Krishnamoorthy</title>
		<link>http://www.bradmcgehee.com/2010/06/june-question-what-is-your-best-advice-for-boosting-index-performance/#comment-605</link>
		<dc:creator>Shankar Krishnamoorthy</dc:creator>
		<pubDate>Mon, 14 Jun 2010 11:25:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.bradmcgehee.com/?p=1577#comment-605</guid>
		<description>Addendum:


Separate your non-clustered indexes from your table and place them on a different filegroup (which should be logically be placed on a different disk, but I have seen the worst)...</description>
		<content:encoded><![CDATA[<p>Addendum:</p>
<p>Separate your non-clustered indexes from your table and place them on a different filegroup (which should be logically be placed on a different disk, but I have seen the worst)&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

