<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" version="2.0">
  <channel>
    <title>Kimberly L. Tripp</title>
    <description>Improving *my* SQL skills through your questions!</description>
    <link>http://www.sqlskills.com/BLOGS/KIMBERLY/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 1.4.5.0</generator>
    <language>en-US</language>
    <blogChannel:blogRoll>http://www.sqlskills.com/BLOGS/KIMBERLY/opml.axd</blogChannel:blogRoll>
    <blogChannel:blink>http://www.sqlskills.com/</blogChannel:blink>
    <dc:creator>Kimberly L. Tripp</dc:creator>
    <dc:title>Kimberly L. Tripp</dc:title>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/KimberlyLTripp" type="application/rss+xml" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">KimberlyLTripp</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
      <title>Looking for security vulnerabilities in database code</title>
      <description>&lt;p&gt;
I&amp;#39;ve always been concerned with security and I&amp;#39;ve always stressed the importance of auditing the REAL user context not just the current user (see &lt;a href="http://www.sqlskills.com/BLOGS/KIMBERLY/post/EXECUTE-AS-and-an-important-update-your-DDL-Triggers-(for-auditing-or-prevention).aspx" target="_blank"&gt;this post&lt;/a&gt; on EXECUTE AS and auditing). So, I generally try to avoid using dynamic string execution and if necessary create well tested/protected parameters (fyi - using QUOTENAME can be a fantasic solution to protectng identifiers as input parameters but it can&amp;#39;t protect more complex strings). 
&lt;/p&gt;
&lt;p&gt;
Having said that, what if I&amp;#39;m looking at a database for the first time... just poking around trying to see if there&amp;#39;s anything that needs further attention? I&amp;#39;ve come up with a quick query... And, while it&amp;#39;s not going to &amp;quot;solve&amp;quot; your problem (as that&amp;#39;s going to take some re-writing of code) or even &lt;em&gt;truly &lt;/em&gt;verify if you&amp;#39;re vulnerable, it gives you a &amp;quot;quick list&amp;quot;&amp;nbsp;of where you should look first! If&amp;nbsp;your code uses dynamic strings AND it&amp;#39;s elevated - then&amp;nbsp;start there!&amp;nbsp; 
&lt;/p&gt;
&lt;font size="5" color="#0000ff"&gt;&lt;font size="5" color="#0000ff"&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;SELECT &lt;font color="#ff00ff"&gt;&lt;font color="#ff00ff"&gt;OBJECT_NAME&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color="#ff00ff"&gt;&lt;font color="#ff00ff"&gt;object_id&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;AS&lt;/font&gt;&lt;/font&gt; [Procedure Name]&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font size="2" color="#808080"&gt;,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp; CASE&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; WHEN&lt;/font&gt;&lt;/font&gt; sm&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;definition&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;LIKE&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;%EXEC (%&amp;#39;&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;OR&lt;/font&gt;&lt;/font&gt; sm&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;definition&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;LIKE&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;%EXEC(%&amp;#39;&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;THEN&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;WARNING: code contains EXEC&amp;#39;&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHEN&lt;/font&gt;&lt;/font&gt; sm&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;definition&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;LIKE&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;%EXECUTE (%&amp;#39;&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;OR&lt;/font&gt;&lt;/font&gt; sm&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;definition&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;LIKE&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;%EXECUTE(%&amp;#39;&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;THEN&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;WARNING: code contains EXECUTE&amp;#39;&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp; END&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;AS&lt;/font&gt;&lt;/font&gt; [Dynamic Strings]&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font size="2" color="#808080"&gt;,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp; CASE&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;WHEN&lt;/font&gt;&lt;/font&gt; execute_as_principal_id &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;IS&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NOT&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;THEN&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;N&amp;#39;WARNING: EXECUTE AS &amp;#39;&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;+&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff00ff"&gt;&lt;font color="#ff00ff"&gt;user_name&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;execute_as_principal_id&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ELSE&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;Code to run as caller - check connection context&amp;#39;&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp; END&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;AS&lt;/font&gt;&lt;/font&gt; [Execution Context Status]&lt;br /&gt;
	&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;&lt;/font&gt; &lt;font color="#008000"&gt;&lt;font color="#008000"&gt;sys&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;font color="#008000"&gt;&lt;font color="#008000"&gt;sql_modules&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;AS&lt;/font&gt;&lt;/font&gt; sm&lt;br /&gt;
	&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;ORDER&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;BY&lt;/font&gt;&lt;/font&gt; [Procedure Name] &lt;/font&gt;
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;
Is this enough? Anything else you&amp;#39;d check? What do you think? 
&lt;/p&gt;
&lt;p&gt;
THANKS!&lt;br /&gt;
kt 
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=MBr6YHzP20E:mrALD987KLY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=MBr6YHzP20E:mrALD987KLY:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=MBr6YHzP20E:mrALD987KLY:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?i=MBr6YHzP20E:mrALD987KLY:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=MBr6YHzP20E:mrALD987KLY:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <link>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Looking-for-security-vulnerabilities-in-database-code.aspx</link>
      <author>kimberly.nospam@nospam.sqlskills.com (kltripp)</author>
      <comments>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Looking-for-security-vulnerabilities-in-database-code.aspx#comment</comments>
      <guid>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=2a2a7de6-c0d5-4b2f-856b-f4df09a91447</guid>
      <pubDate>Tue, 30 Jun 2009 08:34:00 -0700</pubDate>
      <category>Security</category>
      <category>SQL Server 2005</category>
      <category>SQL Server 2008</category>
      <dc:publisher>kltripp</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/KIMBERLY/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=2a2a7de6-c0d5-4b2f-856b-f4df09a91447</pingback:target>
      <slash:comments>16</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/KIMBERLY/trackback.axd?id=2a2a7de6-c0d5-4b2f-856b-f4df09a91447</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Looking-for-security-vulnerabilities-in-database-code.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/KIMBERLY/syndication.axd?post=2a2a7de6-c0d5-4b2f-856b-f4df09a91447</wfw:commentRss>
    </item>
    <item>
      <title>The Tipping Point Query Answers</title>
      <description>&lt;p&gt;
&lt;font size="2"&gt;OK, I&amp;#39;ll definitely take a beating from all of you for having gone so long between my survey posts and now. I won&amp;#39;t even go into the details but between some crazy work schedules, multiple sinus problems and even migraines... well, I&amp;#39;ve been a bit behind. Let&amp;#39;s just say that April/May were rough at best. I&amp;#39;m feeling better and well, now I&amp;#39;m trying to catch up. I had really gotten the blogging bug in March but I completely lost it in April. But, this tipping point series is in dire need of lots of explaining so I&amp;#39;m really hoping to get a few posts done in this area for sure! &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;First, I started the discussion around this in a few surveys: &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font size="3"&gt;&lt;strong&gt;Survey/Question 1&lt;/strong&gt;&lt;/font&gt; 
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;Q1 was described as this: if a table has 1 million rows at 20 rows per page (50,000 pages), at what percentage (roughly) of the data would a nonclustered index no longer be used. Blogged &lt;a href="http://www.sqlskills.com/BLOGS/KIMBERLY/post/Why-arent-those-nonclustered-indexes-being-used.aspx" target="_blank"&gt;here&lt;/a&gt;&lt;/font&gt;&lt;font size="2"&gt;. Here&amp;#39;s what the survey said as of today: &lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;&lt;img src="http://www.sqlskills.com/BLOGS/KIMBERLY/image.axd?picture=2009%2f6%2fTippingPointQuery1Survey.jpg" alt="" /&gt;&lt;/font&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;And, for Q1 the&amp;nbsp;correct result (&lt;strong&gt;Between 0-2% of the rows&lt;/strong&gt;) is actually the best result (but, by no means the overwhelming majority at only 28%). However, often people just &amp;quot;think&amp;quot; the answer is very small. So... I did a few more questions/surveys.&amp;nbsp;&lt;/font&gt; 
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font size="3"&gt;&lt;strong&gt;Survey/Question 2&lt;/strong&gt;&lt;/font&gt; 
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;Q2 was described as this: if a table has 1 million rows at&amp;nbsp;100 rows per page (10,000 pages), at what percentage (roughly) of the data would a nonclustered index no longer be used. Blogged &lt;a href="http://www.sqlskills.com/BLOGS/KIMBERLY/post/Tipping-Point-Queries-More-Questions-To-Really-Test-You!.aspx" target="_blank"&gt;here&lt;/a&gt;&lt;font size="2"&gt;. Here&amp;#39;s what the survey said as of today: &lt;/font&gt;&lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;&lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;img src="http://www.sqlskills.com/BLOGS/KIMBERLY/image.axd?picture=2009%2f6%2fTippingPointQuery2Survey.jpg" alt="" /&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;And, for Q2 the&amp;nbsp;correct result (&lt;strong&gt;Less than .5% of the rows&lt;/strong&gt;) is actually at a tie for the best (but, again, even a small percentage at only 22%). Again, often people just &amp;quot;think&amp;quot; the answer is very small. So... I did one more question/survey.&amp;nbsp;&lt;/font&gt; 
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font size="3"&gt;&lt;strong&gt;Survey/Question 3&lt;/strong&gt;&lt;/font&gt; 
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;Q3 was described as this: if a table has 1 million rows at&amp;nbsp;2 rows per page (500,000 pages), at what percentage (roughly) of the data would a nonclustered index no longer be used. Blogged &lt;a href="http://www.sqlskills.com/BLOGS/KIMBERLY/post/Tipping-Point-Queries-More-Questions-To-Really-Test-You!.aspx" target="_blank"&gt;here&lt;/a&gt;&lt;font size="2"&gt;. Here&amp;#39;s what the survey said as of today: &lt;/font&gt;&lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;img src="http://www.sqlskills.com/BLOGS/KIMBERLY/image.axd?picture=2009%2f6%2fTippingPointQuery3Survey.jpg" alt="" /&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;And, for Q3 the&amp;nbsp;correct result (&lt;strong&gt;Between 10-20% of the rows&lt;/strong&gt;) is actually NOT the highest answer. And, this is even more convincing that there&amp;#39;s confusion around what&amp;#39;s going on and why.&lt;/font&gt; 
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font size="3"&gt;&lt;strong&gt;The Tipping Point&lt;/strong&gt;&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;&lt;strong&gt;What is the tipping point? &lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;It&amp;#39;s the point where the number of rows returned is &amp;quot;no longer selective enough&amp;quot;. SQL Server chooses NOT to use the nonclustered index to look up the corresponding data rows and instead performs a table scan. &lt;/font&gt;
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;strong&gt;&lt;font size="2"&gt;When does the tipping point occur?&lt;/font&gt; &lt;/strong&gt;
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;It depends... it&amp;#39;s MOSTLY tied to the number of pages in the table. Generally, around 30% of the number of PAGES in the table is about where the tipping point occurs. However, parallelism, some server settings (processor affinity and I/O affinity), memory and table size - all can have an impact. And, since it can vary - I typically estimate somewhere between 25% and 33% as a &lt;strong&gt;&lt;u&gt;rough&lt;/u&gt;&lt;em&gt; &lt;/em&gt;&lt;/strong&gt;tipping point (and, you&amp;#39;ll see from a bunch of my examples, that number is not EXACT). Then, I translate that into rows.&lt;/font&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;&lt;strong&gt;Math for Tipping Point Query 3:&lt;/strong&gt; If a table has 500,000 pages then 25% = 125,000 and 33% = 166,000. So, somewhere between 125,000 and 166,000 ROWS the query will tip. Turning that into a percentage 125,000/1million = 12.5% and 166,000/1million = 16.6%. So, if a table has 500,000 pages (and 1 million rows) then queries that return less than 12.5% of the data are likely to USE the nonclustered index to lookup the data and queries over 16.6% of the data are LIKELY to use a table scan. For this table, that percentage seems &amp;quot;reasonable&amp;quot;. But, most of us say that the tipping point happens at a much lower percentage... why? Because&amp;nbsp;row size - which&amp;nbsp;determines table size (and therefore pages) is really what has the greatest impact. So, let&amp;#39;s look at Tipping&amp;nbsp;Point Query 2...&lt;/font&gt;&amp;nbsp; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;&lt;strong&gt;Math for Tipping Point Query 2:&lt;/strong&gt; If a table has 10,000 pages then 25% = 2,500 and 33% = 3,333. So, somewhere between 2,500 and&amp;nbsp;3,333 ROWS the query will tip. Turning that into a percentage 2,500/1million = .25% and 3,333/1million = .33% (not even 1%). So, if a table has only 10,000 pages (and 1 million rows) then queries that return less than a quarter of 1% of the data are likely to USE the nonclustered index to lookup the data and queries over one third of one percent are LIKELY to use a table scan. For this table, that percentage seems really low BUT, at the same time it makes sense (to a point) that a small table would be scanned... but, for less than 1%. 1% is NOT selective enough.&amp;nbsp;For small tables, it might not matter all that much&amp;nbsp;(they&amp;#39;re small, they fit in cache, etc.) but for bigger tables - it might be a big performance problem.&lt;/font&gt;&amp;nbsp; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;&lt;strong&gt;Math for Tipping Point Query 1:&lt;/strong&gt; If a table has 50,000 pages then 25% = 12,500 and 33% = 16,666. So, somewhere between 12,500 and&amp;nbsp;16,666 ROWS the query will tip. Turning that into a percentage 12,500/1million = 1.25% and 16,666/1million = 1.66% (under 2%). So, if a table has 50,000 pages (and 1 million rows) then queries that return less than 1.25% of the data are likely to USE the nonclustered index to lookup the data and queries over 1.66% are LIKELY to use a table scan. Again, this seems like a low number. Again, for small tables, it might not matter all that much&amp;nbsp;(they&amp;#39;re small, they fit in cache, etc.) but as tables get larger and larger - it CAN be a big performance problem.&lt;/font&gt;&amp;nbsp; 
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;strong&gt;&lt;font size="2"&gt;Why is the tipping point interesting?&lt;/font&gt; &lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font size="2"&gt;It shows that narrow (non-covering) nonclustered indexes have fewer uses than often expected (just because a query has a column in the WHERE clause doesn&amp;#39;t mean that SQL Server&amp;#39;s going to use that index) &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font size="2"&gt;It happens at a point that&amp;#39;s typically MUCH earlier than expected... and, in fact, sometimes this is a VERY bad thing! &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font size="2"&gt;Only nonclustered indexes that do not cover a query have a tipping point. Covering indexes don&amp;#39;t have this same issue (which further proves why they&amp;#39;re so important for performance tuning) &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font size="2"&gt;You might find larger tables/queries performing table scans when in fact, it might be better to use a nonclustered index. How do you know, how do you test, how do you hint and/or force... and, is that a good thing?&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font size="2"&gt;&lt;strong&gt;Real example of an interesting tipping point&lt;/strong&gt;&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;Earlier today, I went on facebook and twitter and gave the following information - very vaguely - and I asked &amp;quot;why&amp;quot; is Q2 so much slower than Q1 if Q2 returns only 10 more rows. Same table and&amp;nbsp;no hints (other than MAXDOP)...&lt;/font&gt; 
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;Q1: &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;SELECT &lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;*&lt;/font&gt;&lt;/font&gt;&amp;nbsp;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;&lt;/font&gt;&amp;nbsp;table &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;WHERE&lt;/font&gt;&lt;/font&gt;&amp;nbsp;colx &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt; 597420 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;OPTION &lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;MAXDOP&lt;/font&gt;&lt;/font&gt; 1&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;) &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
	&lt;/p&gt;
	&lt;ul&gt;
		&lt;li&gt;&lt;font size="2"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;returns 197,419 rows&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;
		&lt;li&gt;&lt;font size="2"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;takes 116,031 ms (1 minute, 52 seconds)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;
		&lt;li&gt;&lt;font size="2"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;1,197,700 logical reads, &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;5 physical reads, 137,861 read-ahead reads&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;
		&lt;li&gt;&lt;font size="2"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;7,562 ms CPU time&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; 
		&lt;p&gt;
		&lt;font size="2"&gt;Q2: &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;SELECT &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;*&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;nbsp;table &lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;WHERE&lt;/font&gt;&lt;/font&gt;&amp;nbsp;colx &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt; 597430 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;OPTION &lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;MAXDOP&lt;/font&gt;&lt;/font&gt; 1&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; 
		&lt;/p&gt;
		&lt;/font&gt;&lt;/li&gt;
	&lt;/ul&gt;
	&lt;font size="2"&gt;
	&lt;ul&gt;
		&lt;li&gt;&lt;font size="2"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;returns 197,4&lt;u&gt;2&lt;/u&gt;9 rows&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;
		&lt;li&gt;&lt;font size="2"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;takes&amp;nbsp;244,094 ms (4 minutes,&amp;nbsp;4 seconds)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;
		&lt;li&gt;&lt;font size="2"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;801,685&amp;nbsp;logical reads,&amp;nbsp;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;1410 physical reads,&amp;nbsp;801,678 read-ahead reads&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;
		&lt;li&gt;&lt;font size="2"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;9,188&amp;nbsp;ms CPU time&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;
	&lt;/ul&gt;
	&lt;p&gt;
	There were lots of great guesses... but, it&amp;#39;s the tipping point. SQL Server chose to &amp;quot;tip&amp;quot; the second query because it was &amp;quot;over the line&amp;quot;. But, it&amp;#39;s important to realize that there are cases when that&amp;#39;s NOT a good idea. And, what are your options? 
	&lt;/p&gt;
	&lt;p&gt;
	In SQL Server 2005 - the only option is to force the nonclustered index to be used: 
	&lt;/p&gt;
	&lt;blockquote&gt;
		&lt;p&gt;
		&lt;font size="2"&gt;Q2: &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;SELECT &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;*&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;nbsp;table WITH (INDEX (NCInd)) &lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;WHERE&lt;/font&gt;&lt;/font&gt;&amp;nbsp;colx &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt; 597430 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;OPTION &lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;MAXDOP&lt;/font&gt;&lt;/font&gt; 1&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; 
		&lt;/p&gt;
		&lt;p&gt;
		&lt;font size="2"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2" color="#000000"&gt;But, this can be TERRIBLY bad on some machines where the IOs could be a lot faster (and where data might already be in cache). These &lt;strong&gt;&lt;em&gt;specific &lt;/em&gt;&lt;/strong&gt;numbers are exactly that - specific to this HARDWARE (and, I chose not-so-optimal HW in this case to highlight this problem). And, depending on what number you use (what if this is a parameter in sps?) you might force SQL Server to do WAY more IOs by forcing the index than allowing the tipping point to do its job. But, depending on your hardware (and/or what you know to be in cache at the time of execution), it might be better to force an index instead of letting SQL Server choose. So, should I force the index? Be careful, if you&amp;#39;re wrong - it could take more time and actually be slower.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; 
		&lt;/p&gt;
	&lt;/blockquote&gt;
	&lt;p&gt;
	In SQL Server 2008 - there&amp;#39;s a new hint - FORCESEEK: 
	&lt;/p&gt;
	&lt;blockquote&gt;
		&lt;p&gt;
		&lt;font size="2"&gt;Q2: &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;SELECT &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;*&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;nbsp;table WITH (INDEX (FORCESEEK)) &lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;WHERE&lt;/font&gt;&lt;/font&gt;&amp;nbsp;colx &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt; 597430 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;OPTION &lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;MAXDOP&lt;/font&gt;&lt;/font&gt; 1&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; 
		&lt;/p&gt;
		&lt;p&gt;
		&lt;font size="2"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2" color="#000000"&gt;FORCESEEK is better because it doesn&amp;#39;t tie you to a particular index directly but it also doesn&amp;#39;t let SQL Server tip to a table scan. However, just like forcing an index - you can be wrong! &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
		&lt;/p&gt;
	&lt;/blockquote&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2" color="#000000"&gt;So, what should you do? It depends. If you know your data well and you do some extensive testing you &lt;em&gt;might&lt;/em&gt; consider using a hint (there are some clever things you can do programmatically in sps, I&amp;#39;ll try and dedicate a post to this soon). However, a much better choice (if at all possible) is to consider covering (that&amp;#39;s really my main point :). In my queries, covering is unrealistic because my queries want all columns (the evil SELECT *) but, if your queries are narrower AND they are high-priority, you are better off with a covering index (in many cases) over a hint because an index which covers a query, never tips.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	That&amp;#39;s the answer to the puzzle for now but there&amp;#39;s definitely a lot more to dive into. The Tipping Point can be a very good thing - and it usually works well. But, if you&amp;#39;re finding that you can force an index and get better performance you might want to do some investigating and see if it&amp;#39;s this. Then consider how likely a hint is to help and now you know where you can focus. 
	&lt;/p&gt;
	&lt;p&gt;
	Thanks for reading,&lt;br /&gt;
	kt 
	&lt;/p&gt;
	&lt;/font&gt;
&lt;/blockquote&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=40uim85_UTY:DbmRwFExFcI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=40uim85_UTY:DbmRwFExFcI:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=40uim85_UTY:DbmRwFExFcI:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?i=40uim85_UTY:DbmRwFExFcI:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=40uim85_UTY:DbmRwFExFcI:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <link>http://www.sqlskills.com/BLOGS/KIMBERLY/post/The-Tipping-Point-Query-Answers.aspx</link>
      <author>kimberly.nospam@nospam.sqlskills.com (kltripp)</author>
      <comments>http://www.sqlskills.com/BLOGS/KIMBERLY/post/The-Tipping-Point-Query-Answers.aspx#comment</comments>
      <guid>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=47d66a60-99de-49b0-b50f-be4f26c88f0b</guid>
      <pubDate>Sun, 07 Jun 2009 21:29:00 -0700</pubDate>
      <category>Nonclustered Indexes</category>
      <category>SQL Server 2005</category>
      <category>SQL Server 2008</category>
      <category>The Tipping Point</category>
      <dc:publisher>kltripp</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/KIMBERLY/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=47d66a60-99de-49b0-b50f-be4f26c88f0b</pingback:target>
      <slash:comments>6</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/KIMBERLY/trackback.axd?id=47d66a60-99de-49b0-b50f-be4f26c88f0b</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/KIMBERLY/post/The-Tipping-Point-Query-Answers.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/KIMBERLY/syndication.axd?post=47d66a60-99de-49b0-b50f-be4f26c88f0b</wfw:commentRss>
    </item>
    <item>
      <title>Favorite SSMS Options - and some gotchas</title>
      <description>&lt;p&gt;
&lt;font size="2"&gt;Whenever I setup a new machine, I like to set a few default options in SSMS. Here are my favorites:&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;font size="2"&gt;Tools, Options&lt;/font&gt;&lt;/strong&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font size="2"&gt;Environment&lt;/font&gt; 
	&lt;/div&gt;
	&lt;ul&gt;
		&lt;li&gt;
		&lt;div&gt;
		&lt;font size="2"&gt;Fonts and Colors&lt;/font&gt; 
		&lt;/div&gt;
		&lt;ul&gt;
			&lt;li&gt;
			&lt;div&gt;
			&lt;font size="2"&gt;Text Editor font: Lucida Console (&lt;em&gt;a bit thicker and it&amp;#39;s a fixed-width font&lt;/em&gt;)&lt;/font&gt; 
			&lt;/div&gt;
			&lt;/li&gt;
			&lt;li&gt;
			&lt;div&gt;
			&lt;font size="2"&gt;Text Editor: Selected Text (under display items)&lt;/font&gt; 
			&lt;/div&gt;
			&lt;ul&gt;
				&lt;li&gt;
				&lt;div&gt;
				&lt;font size="2"&gt;Item foreground: Black&lt;/font&gt; 
				&lt;/div&gt;
				&lt;/li&gt;
				&lt;li&gt;
				&lt;div&gt;
				&lt;font size="2"&gt;Item background: Yellow (looks like a highlighter)&lt;/font&gt; 
				&lt;/div&gt;
				&lt;/li&gt;
			&lt;/ul&gt;
			&lt;/li&gt;
			&lt;li&gt;
			&lt;div&gt;
			&lt;font size="2"&gt;Sometimes I&amp;#39;ll also make the results windows have larger fonts - especially if it&amp;#39;s a presentation machine&lt;/font&gt; 
			&lt;/div&gt;
			&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
		&lt;li&gt;
		&lt;div&gt;
		&lt;font size="2"&gt;Keyboard&lt;/font&gt; 
		&lt;/div&gt;
		&lt;ul&gt;
			&lt;li&gt;
			&lt;div&gt;
			&lt;font size="2"&gt;Keyboard scheme: SQL Server 2000 (&lt;em&gt;ok, maybe&amp;nbsp;I&amp;#39;m old-school but the QA keyboard shortcuts still&amp;nbsp;seem a lot more natural than the VS keyboard shortcuts... but, if you&amp;#39;re more of a VS person, then&amp;nbsp;stick with Standard&lt;/em&gt;)&lt;/font&gt; 
			&lt;/div&gt;
			&lt;/li&gt;
			&lt;li&gt;
			&lt;div&gt;
			&lt;font size="2"&gt;Query shortcuts:&lt;/font&gt; 
			&lt;/div&gt;
			&lt;ul&gt;
				&lt;li&gt;
				&lt;div&gt;
				&lt;font size="2"&gt;Ctrl+F1: &lt;/font&gt;&lt;a href="http://www.sqlskills.com/blogs/Kimberly/post/Updates-(fixes)-to-sp_helpindex2.aspx" target="_blank"&gt;&lt;font size="2"&gt;sp_helpindex2&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;&amp;nbsp;(&lt;em&gt;if you highlight an object and then hit Ctrl+F1, then it passes the highlighted object in as a parameter. The only negative is that it doesn&amp;#39;t delimit it so you can&amp;#39;t highlight schema.object unless it&amp;#39;s already quoted for the sp &amp;#39;schema.object&amp;#39;&lt;/em&gt;)&lt;/font&gt; 
				&lt;/div&gt;
				&lt;/li&gt;
				&lt;li&gt;
				&lt;div&gt;
				&lt;font size="+0"&gt;&lt;font size="2"&gt;Ctrl+3: &lt;font face="courier new,courier"&gt;SELECT object_name(object_id) AS ObjName, * FROM sys.dm_db_index_physical_stats(db_id(), NULL, NULL, NULL, NULL) ORDER BY 1, 4 &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
				&lt;/div&gt;
				&lt;/li&gt;
				&lt;li&gt;
				&lt;div&gt;
				&lt;font size="2"&gt;Ctrl+4: other common queries/procedures...&lt;/font&gt; 
				&lt;/div&gt;
				&lt;/li&gt;
			&lt;/ul&gt;
			&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font size="2"&gt;Text Editor&lt;/font&gt; 
	&lt;/div&gt;
	&lt;ul&gt;
		&lt;li&gt;
		&lt;div&gt;
		&lt;font size="2"&gt;All Languages &lt;/font&gt;
		&lt;/div&gt;
		&lt;ul&gt;
			&lt;li&gt;
			&lt;div&gt;
			&lt;font size="2"&gt;Line numbers &lt;/font&gt;
			&lt;/div&gt;
			&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
		&lt;li&gt;
		&lt;div&gt;
		&lt;font size="2"&gt;Editor Tab and Status Bar - I usually change the colors of the &amp;quot;Group connections&amp;quot; setting to something very noticeable like Fuschia. I&amp;#39;ve already blogged why &lt;a href="http://www.sqlskills.com/BLOGS/KIMBERLY/post/SQL-Server-2008-Central-Management-Servers-have-you-seen-these.aspx" target="_blank"&gt;here&lt;/a&gt;.&lt;/font&gt; 
		&lt;/div&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font size="2"&gt;Query Execution&lt;/font&gt; 
	&lt;/div&gt;
	&lt;ul&gt;
		&lt;li&gt;
		&lt;div&gt;
		&lt;font size="2"&gt;By default, open new queries in SQLCMD mode (&lt;em&gt;however, if you set this - you will disable Intellisense and Transact-SQL Debugging... and, there&amp;#39;s no &amp;quot;hint&amp;quot; or warning that you&amp;#39;re doing it.&lt;/em&gt;)&lt;/font&gt; 
		&lt;/div&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font size="2"&gt;Query Results&lt;/font&gt; 
	&lt;/div&gt;
	&lt;ul&gt;
		&lt;li&gt;
		&lt;div&gt;
		&lt;font size="2"&gt;SQL Server, Results to Grid&lt;/font&gt; 
		&lt;/div&gt;
		&lt;ul&gt;
			&lt;li&gt;
			&lt;div&gt;
			&lt;font size="2"&gt;Include the query in the result set (&lt;em&gt;this will show you what you executed in the results window while you wait for completion... also confirms what you think you executed. This gets annoying for large batches but is sometimes useful to see what you last executed&lt;/em&gt;)&lt;/font&gt; 
			&lt;/div&gt;
			&lt;/li&gt;
			&lt;li&gt;
			&lt;div&gt;
			&lt;font size="2"&gt;Include column headers when copying or saving the results (&lt;em&gt;VERY useful if you&amp;#39;re pushing data over to Excel, etc.&lt;/em&gt;)&lt;/font&gt; 
			&lt;/div&gt;
			&lt;/li&gt;
			&lt;li&gt;
			&lt;div&gt;
			&lt;font size="2"&gt;Display results in a separate tab (&lt;em&gt;this gives you Tabbed mode instead of split-window mode meaning that results will go to a results Tab instead of the lower half of your window. I prefer this when I have a lot of results to review AND when I&amp;#39;m presenting and typically run with a lower screen res.&lt;/em&gt;)&lt;/font&gt; 
			&lt;/div&gt;
			&lt;ul&gt;
				&lt;li&gt;
				&lt;div&gt;
				&lt;font size="2"&gt;Switch to results tab after the query executes (I prefer this so that I&amp;#39;m waiting for the results in the results window)&lt;/font&gt; 
				&lt;/div&gt;
				&lt;/li&gt;
			&lt;/ul&gt;
			&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
		&lt;li&gt;
		&lt;div&gt;
		&lt;font size="2"&gt;SQL Server, Results to Text&lt;/font&gt; 
		&lt;/div&gt;
		&lt;ul&gt;
			&lt;li&gt;
			&lt;div&gt;
			&lt;font size="2"&gt;I set most of the same settings as Results to Grid (Include column headers, Include the query, Display results in separate tab and Switch to the results tab) BUT, I usually turn off Scroll results as received. If I&amp;#39;m looking at rows at the top of the set (while it&amp;#39;s still processing) it often takes my cursor down to the end. I also turn this off in Profiler.&lt;/font&gt; 
			&lt;/div&gt;
			&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font size="2"&gt;The primary reason for this post though - is to make sure that you realize that one specific option - Tools, Options, Query Execution, &amp;quot;By default, open new queries in SQLCMD mode&amp;quot; - can really surprise you. I used to think that this option was really helpful (and benign) because SQLCMD is a superset of Transact-SQL. So, I typically recommended that you turn it on. However, turning on this option disables Intellisense and the Transact-SQL Debugger. It&amp;#39;s documented here: &lt;a href="http://msdn.microsoft.com/en-us/library/ms174187.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms174187.aspx&lt;/a&gt;&amp;nbsp;(thanks Paul Mestemaker! :) and I thought this was a bit unintuitive at first but it really does make sense. Both the Transact-SQL Debugger and Intellisense are debugging and/or prompting you with Transact-SQL (not SQLCMD commands). So, disabling it seems right (well, I guess I could argue that it could work with Intellisense but debugging would be much harder). However, I just wish there were some better information in the Tools/Options dialog. I&amp;#39;d like my 2 hours back (trying to figure out which option disabled Intellisense, chatting with my friends on fb to see if they knew, filing a connect bug when I figured out that it was SQLCMD, and then learning from Paul Mest that it&amp;#39;s actually expected behavior (duh!), changing the Connect bug to say that the dialog might be better with a warning... it was definitely one of those mornings!&amp;nbsp;&amp;nbsp;:) :) :)&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;So, my main point for this post - save you the time I lost in trying to figure out where Intellisense went. It&amp;#39;s expected behavior (and it does make sense........now :).&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;Cheers,&lt;br /&gt;
kt&lt;/font&gt; 
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=6lQido_yIeo:Fvp1Z88mMM0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=6lQido_yIeo:Fvp1Z88mMM0:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=6lQido_yIeo:Fvp1Z88mMM0:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?i=6lQido_yIeo:Fvp1Z88mMM0:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=6lQido_yIeo:Fvp1Z88mMM0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <link>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Favorite-SSMS-Options-and-some-gotchas.aspx</link>
      <author>kimberly.nospam@nospam.sqlskills.com (kltripp)</author>
      <comments>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Favorite-SSMS-Options-and-some-gotchas.aspx#comment</comments>
      <guid>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=bd638d4c-b219-410e-96a6-ad732474bd44</guid>
      <pubDate>Sat, 06 Jun 2009 20:03:00 -0700</pubDate>
      <category>Manageability</category>
      <category>Tools</category>
      <dc:publisher>kltripp</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/KIMBERLY/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=bd638d4c-b219-410e-96a6-ad732474bd44</pingback:target>
      <slash:comments>3</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/KIMBERLY/trackback.axd?id=bd638d4c-b219-410e-96a6-ad732474bd44</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Favorite-SSMS-Options-and-some-gotchas.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/KIMBERLY/syndication.axd?post=bd638d4c-b219-410e-96a6-ad732474bd44</wfw:commentRss>
    </item>
    <item>
      <title>SSMS Error possibly related to database compatibility mode</title>
      <description>&lt;p&gt;
&lt;font size="2"&gt;I&amp;#39;ve seen (and heard of a few other cases where people received) the following error:&lt;/font&gt; 
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;strong&gt;&lt;font face="courier new,courier" size="3"&gt;Index (zero based) must be greater than or equal to zero and less than the size of the argument list.&lt;/font&gt;&lt;/strong&gt; 
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font size="2"&gt;And, the problem (when I got this error) was the compatibility mode of the database I was in didn&amp;#39;t support what was being attempted. In SQL Server 2005, the reports used to generate an &amp;quot;&lt;font face="courier new,courier"&gt;&lt;strong&gt;&lt;font&gt;Incorrect syntax near &amp;#39;(&amp;#39;.&lt;/font&gt;&amp;quot;&lt;/strong&gt;&lt;/font&gt; error. For what I was trying to do (execute/access some of the standard reports from within SQL Server &lt;strong&gt;200&lt;u&gt;8&lt;/u&gt;&lt;/strong&gt; Management Studio), I received this error and immediately thought it might be the compat mode. Sure enough, it was.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;So, I don&amp;#39;t know how often this will help you but just in case - I thought I&amp;#39;d post this!&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;Cheers,&lt;br /&gt;
kt&lt;/font&gt; 
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=2Vakh4AMj34:3H9-z2ywK-g:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=2Vakh4AMj34:3H9-z2ywK-g:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=2Vakh4AMj34:3H9-z2ywK-g:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?i=2Vakh4AMj34:3H9-z2ywK-g:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=2Vakh4AMj34:3H9-z2ywK-g:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <link>http://www.sqlskills.com/BLOGS/KIMBERLY/post/SSMS-Error-possibly-related-to-database-compatibility-mode.aspx</link>
      <author>kimberly.nospam@nospam.sqlskills.com (kltripp)</author>
      <comments>http://www.sqlskills.com/BLOGS/KIMBERLY/post/SSMS-Error-possibly-related-to-database-compatibility-mode.aspx#comment</comments>
      <guid>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=860ee84a-c0bc-4538-a670-8095457801ce</guid>
      <pubDate>Thu, 07 May 2009 09:55:00 -0700</pubDate>
      <category>SQL Server 2008</category>
      <category>Standard Reports</category>
      <dc:publisher>kltripp</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/KIMBERLY/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=860ee84a-c0bc-4538-a670-8095457801ce</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/KIMBERLY/trackback.axd?id=860ee84a-c0bc-4538-a670-8095457801ce</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/KIMBERLY/post/SSMS-Error-possibly-related-to-database-compatibility-mode.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/KIMBERLY/syndication.axd?post=860ee84a-c0bc-4538-a670-8095457801ce</wfw:commentRss>
    </item>
    <item>
      <title>Social networking, keeping up with friends/family and getting more tech info!</title>
      <description>&lt;p&gt;
OK, I know I don&amp;#39;t blog all that often but when I do, I do try and post as much useful information as I can :). I&amp;#39;ve got a few posts in the queue and a few more tests to do and code to write before I can wrap them up. In the interim, Paul and I have both decided to throw a bit of our &amp;quot;spare time&amp;quot; to keeping up with friends and family more and just staying &amp;quot;more connected.&amp;quot; In that effort, we&amp;#39;ve both joined facebook and twitter (&lt;a href="http://www.twitter.com/KimberlyLTripp"&gt;www.twitter.com/KimberlyLTripp&lt;/a&gt;&amp;nbsp;and &lt;a href="http://www.twitter.com/PaulRandal"&gt;www.twitter.com/PaulRandal&lt;/a&gt;). Our end goal is: 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;strong&gt;Blogging&lt;/strong&gt;: large/complex posts with detailed info/code, etc. 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;strong&gt;Twitter&lt;/strong&gt;: short, quick posts on things to check out, review, etc. Maybe I&amp;#39;ll do a weekly summary of tweets that I do and/or followed? &lt;strong&gt;&lt;em&gt;Would you be interested in that?&lt;/em&gt;&lt;/strong&gt; And, as for my interface, I&amp;#39;m currently using TweetDeck and Twitter.com and I&amp;#39;ve also joined via WeFollow.com: #sqlserver, #mvp and #womenintech. 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;strong&gt;Facebook&lt;/strong&gt;: more fun stuff and keeping up with friends, etc. I have to admit that I really love the interface and I&amp;#39;m constantly impressed at how easy it is to upload video, photos, etc... It&amp;#39;s just NOT what I expected before I tried it out. I&amp;#39;d truly recommend this to anyone that wants to asynchronously keep up with a large number of people and wants to share photos, comments, video, etc. It&amp;#39;s really well done. However, beware of many of the facebook apps. They tend to spam your friends list - sometimes even when they don&amp;#39;t ask. Outside of better requirements on fb app developers, I don&amp;#39;t have a lot of complaints there. 
	&lt;/div&gt;
	&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Having said that, neither of us is doing anything else (no Plaxo, no LinkedIn, etc.) so if you want to find us - we&amp;#39;re definitely around but we&amp;#39;re going to stay &lt;em&gt;somewhat&lt;/em&gt; focused. ;-) 
&lt;/p&gt;
&lt;p&gt;
And, now that I&amp;#39;m back home again, I hope to have a few more of my longer posts done. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Cheers everyone!&lt;br /&gt;
&lt;/strong&gt;kt 
&lt;/p&gt;
&lt;a href="http://www.facebook.com/people/Kimberly-L-Tripp/600530451" target="_TOP" title="Kimberly L. Tripp's Facebook profile"&gt;&lt;img style="border: 0px" src="http://badge.facebook.com/badge/600530451.1159.1643141752.png" alt="Kimberly L. Tripp's Facebook profile" hspace="10" width="120" height="309" align="left" /&gt;&lt;/a&gt; &lt;a href="http://www.facebook.com/people/Paul-Randal/1293146061" target="_TOP" title="Paul Randal's Facebook profile"&gt;&lt;img style="border: 0px" src="http://badge.facebook.com/badge/1293146061.635.649828437.png" alt="Paul Randal's Facebook profile" width="120" height="297" /&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=Qz7GdtEl824:SAiwo_Gl6_c:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=Qz7GdtEl824:SAiwo_Gl6_c:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=Qz7GdtEl824:SAiwo_Gl6_c:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?i=Qz7GdtEl824:SAiwo_Gl6_c:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=Qz7GdtEl824:SAiwo_Gl6_c:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <link>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Social-networking-keeping-up-with-friendsfamily-and-getting-more-tech-info!.aspx</link>
      <author>kimberly.nospam@nospam.sqlskills.com (kltripp)</author>
      <comments>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Social-networking-keeping-up-with-friendsfamily-and-getting-more-tech-info!.aspx#comment</comments>
      <guid>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=6bcffd8e-b225-4135-befc-e2efe249a329</guid>
      <pubDate>Wed, 29 Apr 2009 12:37:00 -0700</pubDate>
      <category>Opinions</category>
      <category>Personal</category>
      <dc:publisher>kltripp</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/KIMBERLY/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=6bcffd8e-b225-4135-befc-e2efe249a329</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/KIMBERLY/trackback.axd?id=6bcffd8e-b225-4135-befc-e2efe249a329</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Social-networking-keeping-up-with-friendsfamily-and-getting-more-tech-info!.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/KIMBERLY/syndication.axd?post=6bcffd8e-b225-4135-befc-e2efe249a329</wfw:commentRss>
    </item>
    <item>
      <title>Companion content for Chapter 6 (Index Internals) of SQL Server 2008 Internals</title>
      <description>&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;
&lt;font face="verdana,geneva" size="2"&gt;Recently,&amp;nbsp;the &lt;/font&gt;&lt;a href="http://www.amazon.com/gp/product/0735626243/ref=s9_sims_c2_s1_p14_i1?pf_rd_m=ATVPDKIKX0DER&amp;amp;pf_rd_s=center-2&amp;amp;pf_rd_r=00E7E83CBCNR0DG2TMQ2&amp;amp;pf_rd_t=101&amp;amp;pf_rd_p=470938631&amp;amp;pf_rd_i=507846" target="_blank"&gt;&lt;font face="verdana,geneva" size="2"&gt;SQL Server 2008 Internals&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; title was released (and only in the past few days have people actually received their copies)! In fact, I still haven&amp;#39;t seen the book in person... soon though!&lt;/font&gt; 
&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;
Anyway, &lt;a href="http://sqlblog.com/blogs/kalen_delaney/default.aspx" target="_blank"&gt;&lt;font face="verdana,geneva" size="2"&gt;Kalen&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;, &lt;/font&gt;&lt;a href="http://www.SQLskills.com/blogs/Paul" target="_blank"&gt;&lt;font face="verdana,geneva" size="2"&gt;Paul&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;, &lt;/font&gt;&lt;a href="http://blogs.msdn.com/conor_cunningham_msft/default.aspx" target="_blank"&gt;&lt;font face="verdana,geneva" size="2"&gt;Conor&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;, &lt;/font&gt;&lt;a href="http://sqlblog.com/blogs/adam_machanic/default.aspx" target="_blank"&gt;&lt;font face="verdana,geneva" size="2"&gt;Adam&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;&lt;font face="verdana,geneva"&gt;&amp;nbsp;and I worked to create a comprehensive resource on SQL Server 2008 internals and to supplement the written content, many of us created demo scripts and examples. I&amp;#39;ve now gone back and created a sample script based on ALL of the code in the entire chapter (and in many cases I extended the code in the samples). And, while this updated content is going to be located on the companion content site, I thought I&amp;rsquo;d also release it here with some notes.&lt;/font&gt;&lt;font face="verdana,geneva"&gt; &lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;
&lt;font face="verdana,geneva" size="2"&gt;The zip contains a solution with 3 projects, each with a few scripts: &lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;
&lt;font size="2"&gt;&lt;font face="verdana,geneva"&gt;&lt;img src="http://www.sqlskills.com/BLOGS/KIMBERLY/image.axd?picture=2009%2f4%2fIndexInternals-Chapter6-Resources.jpg" alt="" width="547" height="680" /&gt;&lt;/font&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;
&lt;font size="2"&gt;&lt;font face="verdana,geneva"&gt;I know the names seem a bit strange but everything is ordered EXACTLY as it is shown in the book. And, in the book, I referenced &amp;quot;a&amp;quot; script called EmployeeCaseStudy-AnalyzeStructures.sql but that script was so big that I broke it down into 7 parts (hence the naming convention of 06...01, 06...02, etc.). Regardless, each script contains a brief header and a few details about the script. To get the most from the script, do not just open the script and execute it. If you really work your way through the script, you should see all of the comments and they will help you to make instance specific changes so that everything runs without error. Just take your time and really try to step back and think about each command (and what you&amp;#39;re expecting the output to be) to test yourself while your working through the results. Taking your time and really grapsing all of these internals is what makes it fun!&lt;/font&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;
&lt;font size="2"&gt;&lt;font face="verdana,geneva"&gt;Quite a bit of this content can stand alone but it&amp;#39;s really best as companion content to the title as there&amp;#39;s a lot more &amp;quot;text&amp;quot; and detailed information in the book. But, the scripts are really a great way to dive deeper, learn documented/undocumented commands and really get to know what the heck is really going on internally.&lt;/font&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;
&lt;font face="verdana,geneva"&gt;&lt;font size="2"&gt;Finally, I only worked on Chapter 6 so here it is: &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/KIMBERLY/file.axd?file=2009%2f4%2f20090413_IndexInternals-Chapter6-Resources.zip"&gt;&lt;font size="2"&gt;20090413_IndexInternals-Chapter6-Resources.zip (12.22 mb)&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;font size="2"&gt;. As for the other companion content, you&amp;#39;ll need to get&amp;nbsp;the links from the book. Ah, or&amp;nbsp;from Kalen :).&amp;nbsp; &lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;
&lt;font size="2"&gt;And, certainly, if you find a typo or anything that you think needs more clarification, let me know! I&amp;#39;m more than happy to post updates to this content.&amp;nbsp; &lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;
&lt;font size="2"&gt;&lt;strong&gt;Have fun,&lt;/strong&gt;&lt;br /&gt;
kt &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;font size="2"&gt;UPDATES/ERRORLOG: &lt;/font&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;2009-Apr-13 (8am): &lt;/strong&gt;Updated the zip after remembering in my sleep (yes, sad, but true!) that one of my &lt;strong&gt;comments&lt;/strong&gt; that referenced some line numbers didn&amp;#39;t get updated in the final version. So, no errors and if you don&amp;#39;t get this update, it&amp;#39;s not going to break anything. But, the script that&amp;#39;s been tweaked is script: &lt;font face="courier new,courier"&gt;05_EmployeeCaseStudy-TableDefinition.sql&lt;/font&gt;. Enjoy! kt &lt;br /&gt;
&lt;strong&gt;2009-Apr-13 (4:30pm): &lt;/strong&gt;Ha... guess what arrived today. Yes - our copies of the book. Wow, it&amp;#39;s great to see it in person. Again, enjoy! 
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=Z3wEZKJoS6I:x9F0dRk45HI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=Z3wEZKJoS6I:x9F0dRk45HI:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=Z3wEZKJoS6I:x9F0dRk45HI:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?i=Z3wEZKJoS6I:x9F0dRk45HI:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=Z3wEZKJoS6I:x9F0dRk45HI:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <link>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Companion-content-for-Chapter-6-(Index-Internals)-of-SQL-Server-2008-Internals.aspx</link>
      <author>kimberly.nospam@nospam.sqlskills.com (kltripp)</author>
      <comments>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Companion-content-for-Chapter-6-(Index-Internals)-of-SQL-Server-2008-Internals.aspx#comment</comments>
      <guid>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=85a23001-cdb9-453a-8e51-ee731c1c2991</guid>
      <pubDate>Sun, 12 Apr 2009 23:20:00 -0700</pubDate>
      <category>Indexes</category>
      <category>Resources</category>
      <category>SQL Server 2008</category>
      <dc:publisher>kltripp</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/KIMBERLY/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=85a23001-cdb9-453a-8e51-ee731c1c2991</pingback:target>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/KIMBERLY/trackback.axd?id=85a23001-cdb9-453a-8e51-ee731c1c2991</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Companion-content-for-Chapter-6-(Index-Internals)-of-SQL-Server-2008-Internals.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/KIMBERLY/syndication.axd?post=85a23001-cdb9-453a-8e51-ee731c1c2991</wfw:commentRss>
    </item>
    <item>
      <title>Paul's Survey - Does size really matter or is it what you do with it?</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;If you haven&amp;#39;t seen Paul&amp;#39;s weekly survey, please take a look. We&amp;#39;re trying to get a feel for the general state of database structures out there... Here&amp;#39;s the link: &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Weekly-survey-does-size-really-matter-or-is-it-what-you-do-with-it.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;http://www.sqlskills.com/BLOGS/PAUL/post/Weekly-survey-does-size-really-matter-or-is-it-what-you-do-with-it.aspx&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font&gt;&lt;font face="verdana,geneva"&gt;&lt;font size="2"&gt;&lt;strong&gt;THANKS and have a great weekend!&lt;br /&gt;
&lt;/strong&gt;kt&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=hiqn04XBH2U:umDFkR1AhR0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=hiqn04XBH2U:umDFkR1AhR0:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=hiqn04XBH2U:umDFkR1AhR0:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?i=hiqn04XBH2U:umDFkR1AhR0:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=hiqn04XBH2U:umDFkR1AhR0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <link>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Pauls-Survey-Does-size-really-matter-or-is-it-what-you-do-with-it.aspx</link>
      <author>kimberly.nospam@nospam.sqlskills.com (kltripp)</author>
      <comments>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Pauls-Survey-Does-size-really-matter-or-is-it-what-you-do-with-it.aspx#comment</comments>
      <guid>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=c4d95d51-9944-4799-a1d9-956eb0781556</guid>
      <pubDate>Fri, 10 Apr 2009 15:28:00 -0700</pubDate>
      <category>Survey</category>
      <dc:publisher>kltripp</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/KIMBERLY/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=c4d95d51-9944-4799-a1d9-956eb0781556</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/KIMBERLY/trackback.axd?id=c4d95d51-9944-4799-a1d9-956eb0781556</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Pauls-Survey-Does-size-really-matter-or-is-it-what-you-do-with-it.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/KIMBERLY/syndication.axd?post=c4d95d51-9944-4799-a1d9-956eb0781556</wfw:commentRss>
    </item>
    <item>
      <title>RunAsRadio Interview about Developers and DBAs - whose job is it?</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;A couple of weeks ago I wrote a blog post titled &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/KIMBERLY/post/Whose-job-is-it-anyway.aspx" target="_blank"&gt;&lt;font face="verdana,geneva" size="2"&gt;Whose job is it anyway?&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;It&amp;#39;s an interesting debate and something I&amp;#39;ve been hearing more and more - that SQL Server is a &amp;quot;set it and forget it&amp;quot; technology - a black box where you just don&amp;#39;t need to know how it works to do well with it. In fact, I&amp;#39;ve even had a few folks comment that they think it would be better to &amp;quot;roll their own&amp;quot; database rather than have to learn how to work in a &amp;quot;general purpose&amp;quot; database. And, while there are certainly lots of different angle to this debate - one fact remains... if you don&amp;#39;t know anything about the database on which you&amp;#39;re developing (whether it&amp;#39;s SQL Server, mySQL, Oracle, whatever), I *PROMISE* you won&amp;#39;t have a truly scalable, optimal solution. Why do you think there are so many knobs? It&amp;#39;s because there are so many different ways to work with data. There is more than one way to query, more than one way to design. This is also why every answer to a &amp;quot;how should I do this&amp;quot; question starts with &amp;quot;It depends&amp;quot;. And, while that seems like a scary response it&amp;#39;s actually a good one. It means that you have lots of options - options that can offer many different pros/cons. And, as a result of knowing these pros/cons, you can make better decisions - decisions that will ultimately determine how well you can scale. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;So..... while I don&amp;#39;t think this debate will EVER be finished (as to WHOSE job it is to know these things), I do think a lot of folks are seeing the effects of not knowing more about their store (and, again, this is NOT limited to SQL Server in any way, shape or form). &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;At a minimum, hear the discussion on &lt;/font&gt;&lt;a href="http://www.runasradio.com/" target="_blank"&gt;&lt;font face="verdana,geneva" size="2"&gt;RunAsRadio&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;with Richard, Greg and I and let us know what you think! &lt;/font&gt;
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;a href="http://www.runasradio.com/default.aspx?showNum=104" target="_blank"&gt;&lt;font face="verdana,geneva" size="2"&gt;Kim Tripp on the Roles of Developers and DBAs with the Database!&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; &lt;/font&gt;
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Cheers,&lt;br /&gt;
kt &lt;/font&gt;
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=k5t2zkNLEBk:_WuZUrC2XH0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=k5t2zkNLEBk:_WuZUrC2XH0:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=k5t2zkNLEBk:_WuZUrC2XH0:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?i=k5t2zkNLEBk:_WuZUrC2XH0:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=k5t2zkNLEBk:_WuZUrC2XH0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <link>http://www.sqlskills.com/BLOGS/KIMBERLY/post/RunAsRadio-Interview-about-Developers-and-DBAs-whose-job-is-it.aspx</link>
      <author>kimberly.nospam@nospam.sqlskills.com (kltripp)</author>
      <comments>http://www.sqlskills.com/BLOGS/KIMBERLY/post/RunAsRadio-Interview-about-Developers-and-DBAs-whose-job-is-it.aspx#comment</comments>
      <guid>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=2dad3a5e-27ee-4b6b-b218-f4911657465e</guid>
      <pubDate>Fri, 10 Apr 2009 10:52:00 -0700</pubDate>
      <category>Design</category>
      <category>Events</category>
      <category>Manageability</category>
      <category>Opinions</category>
      <category>Resources</category>
      <category>SQL Server 2005</category>
      <category>SQL Server 2008</category>
      <category>Tips</category>
      <dc:publisher>kltripp</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/KIMBERLY/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=2dad3a5e-27ee-4b6b-b218-f4911657465e</pingback:target>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/KIMBERLY/trackback.axd?id=2dad3a5e-27ee-4b6b-b218-f4911657465e</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/KIMBERLY/post/RunAsRadio-Interview-about-Developers-and-DBAs-whose-job-is-it.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/KIMBERLY/syndication.axd?post=2dad3a5e-27ee-4b6b-b218-f4911657465e</wfw:commentRss>
    </item>
    <item>
      <title>Spring cleaning your indexes - Part II</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;I started the series here: &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/KIMBERLY/post/Spring-cleaning-your-indexes-Part-I.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;http://www.sqlskills.com/BLOGS/KIMBERLY/post/Spring-cleaning-your-indexes-Part-I.aspx&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;and I want to continue with Part II today by clarifying some great questions/comments that have come up on the series. In Part III, I&amp;#39;ll give you a few more ways to get rid of (or consolidate) indexes. And, I think there&amp;#39;s still a bit more that &lt;a href="http://www.SQLskills.com/blogs/Paul" target="_blank"&gt;Paul&lt;/a&gt; and I will investigate further (wrt to operational stats) but, I want to address a few comments and a few interesting things that both Paul and I have found. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;In the Part I post, I&amp;nbsp;talked about using sys.dm_db_index_usage_stats to see if there are any indexes that just aren&amp;#39;t being used at all... A few comments asked why I didn&amp;#39;t use operational_stats instead. To address that first, there are a few key differences: &lt;/font&gt;
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;dm_db_index_operational_stats is persisted only as long as an object is in cache (however, it&amp;#39;s not cleared when objects are forced out of cache with DBCC DROPCLEANBUFFERS). If you want to clear ALL DMVs for a specific database, then a relatively easy way to do this (IN TESTING) is to take the database offline and then immediately bring it online again. &lt;/font&gt;
	&lt;/div&gt;
	&lt;ul&gt;
		&lt;li&gt;
		&lt;div&gt;
		&lt;font face="verdana,geneva" size="2"&gt;ALTER DATABASE &amp;lt;dbname&amp;gt; SET OFFLINE&lt;/font&gt; 
		&lt;/div&gt;
		&lt;/li&gt;
		&lt;li&gt;
		&lt;div&gt;
		&lt;div&gt;
		&lt;font face="verdana,geneva" size="2"&gt;ALTER DATABASE &amp;lt;dbname&amp;gt; SET ONLINE&lt;/font&gt; 
		&lt;/div&gt;
		&lt;/div&gt;
		&lt;ul&gt;
			&lt;li&gt;
			&lt;div&gt;
			&lt;div&gt;
			&lt;font face="verdana,geneva" size="2"&gt;NOTE: If there are any suspect files, you will NOT be able to bring your database back online without FIRST taking all suspect files OFFLINE. And, if you take a FILE offline then it&amp;#39;s even more important to know that THERE IS NO WAY TO BRING A FILE ONLINE without restoring it from backups. So, it&amp;#39;s VERY important to understand that OFFLINE/ONLINE for a database is really easy IF AND ONLY IF there are no other problems with the DB. You really need to resolve those problems first (or at least know that you&amp;#39;re going to need to resolve those problems later through backup/restore) before you take a database offline.&lt;/font&gt; 
			&lt;/div&gt;
			&lt;/div&gt;
			&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;dm_db_index_operational_stats is (from BOL) &lt;em&gt;neither persistent nor transactionally consistent. This means you cannot use these counters to determine whether an index has been used or not, or when the index was last used. For information about this, see sys.dm_db_index_usage_stats.&lt;/em&gt; &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Having said that though, &lt;strong&gt;&lt;u&gt;none&lt;/u&gt;&lt;/strong&gt; of these are really any guarantee of perfect information. And, they&amp;#39;re not meant to be. I look at these DMVs as being a quick and easy way to get some relatively descent insight into what is or is not happening in my environement. However, even though the sys.dm_db_index_operational_stats might give you insight that you have a problem it still doesn&amp;#39;t give you good insight into exactly what that problem might be. For example, it *might* be splits that causes some of your wait times to increase (column: page_io_latch_wait_in_ms) but, it could be something else too (some other system issue). &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The main point, you can use these to get insight into which tables have the biggest problems (i.e. the biggest waits) and where they &lt;em&gt;might &lt;/em&gt;have a lot of splits (column:nonleaf_allocation_count) but, in all honesty, that&amp;#39;s not a guarantee. In fact, the reason I said &amp;quot;might&amp;quot; is that pages that are allocated at the end of the leaf level STILL allocate a page and require an entry to be made in the next level up in the index. So, a lot of nonleaf_allocations COULD be for a perfectly unfragmented index. So, it still doesn&amp;#39;t tell you how fragmented the objects are or what the REAL problem is (or even if it is a problem yet). &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Basically,&amp;nbsp;these just tell you where you have the most activity and give you a starting point for problem solving. But, none of these (usage or operational) really tell you &lt;em&gt;how &lt;/em&gt;to solve the problem. However, sometimes even knowing where to start IS the problem in and of itself. So, I&amp;#39;m not against these DMVs and I really do think you can get some good insight from them. Just use them as a tool to help focus your investigations. Use better tools like sys.dm_db_index_physical_stats to really see if you have fragmentation and where it&amp;#39;s the worst.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;hth,&lt;br /&gt;
kt&lt;/font&gt; 
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=nPT3ip-5nJ4:INduHxapI3I:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=nPT3ip-5nJ4:INduHxapI3I:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=nPT3ip-5nJ4:INduHxapI3I:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?i=nPT3ip-5nJ4:INduHxapI3I:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=nPT3ip-5nJ4:INduHxapI3I:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <link>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Spring-cleaning-your-indexes-Part-II.aspx</link>
      <author>kimberly.nospam@nospam.sqlskills.com (kltripp)</author>
      <comments>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Spring-cleaning-your-indexes-Part-II.aspx#comment</comments>
      <guid>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=92c56d40-4631-4bd8-a790-9a5424c4406d</guid>
      <pubDate>Fri, 27 Mar 2009 09:33:00 -0700</pubDate>
      <category>Database Maintenance</category>
      <category>Indexes</category>
      <category>SQL Server 2005</category>
      <category>SQL Server 2008</category>
      <category>Tips</category>
      <dc:publisher>kltripp</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/KIMBERLY/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=92c56d40-4631-4bd8-a790-9a5424c4406d</pingback:target>
      <slash:comments>3</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/KIMBERLY/trackback.axd?id=92c56d40-4631-4bd8-a790-9a5424c4406d</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Spring-cleaning-your-indexes-Part-II.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/KIMBERLY/syndication.axd?post=92c56d40-4631-4bd8-a790-9a5424c4406d</wfw:commentRss>
    </item>
    <item>
      <title>Good strategies - excellent improvements... thanks Jim!</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;This morning, I woke to a wonderful email and I thought I would share it:&lt;/font&gt; 
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;span style="font-size: 10pt; font-family: 'Arial','sans-serif'"&gt;&lt;font face="verdana,geneva"&gt;&lt;em&gt;Good morning Kimberly,&lt;/em&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Arial','sans-serif'"&gt;&lt;font face="verdana,geneva"&gt;&lt;em&gt;&amp;nbsp;&lt;/em&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Arial','sans-serif'"&gt;&lt;font face="verdana,geneva"&gt;&lt;em&gt;I just wanted to send you an email to let you know how awesome you are!&lt;/em&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Arial','sans-serif'"&gt;&lt;font face="verdana,geneva"&gt;&lt;em&gt;&amp;nbsp;&lt;/em&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Arial','sans-serif'"&gt;&lt;font face="verdana,geneva"&gt;&lt;em&gt;I have applied some of your indexing strategies to our website&amp;rsquo;s homegrown CMS and we are experiencing a significant performance increase. WOW....amazing tips delivered in an exciting way!&lt;/em&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Arial','sans-serif'"&gt;&lt;font face="verdana,geneva"&gt;&lt;em&gt;&amp;nbsp;&lt;/em&gt;&lt;/font&gt;&lt;/span&gt; 
	&lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;
	&lt;span style="font-size: 10pt; font-family: 'Arial','sans-serif'"&gt;&lt;font face="verdana,geneva"&gt;&lt;em&gt;Thanks again,&lt;br /&gt;
	&lt;/em&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Arial','sans-serif'"&gt;&lt;font face="verdana,geneva"&gt;&lt;em&gt;Jim&lt;/em&gt;&lt;/font&gt;&lt;/span&gt; 
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;span style="font-size: 10pt; font-family: 'Arial','sans-serif'"&gt;&lt;font face="verdana,geneva"&gt;OK, I seriously can&amp;#39;t complain about the awesome part ;-)... but, what I think is so cool is that he sent the email. No, I don&amp;#39;t expect everyone to send me mail after they implement a tip/trick BUT, it&amp;#39;s really nice when I do get an email (especially like this :). There are so many ways to improve performance and some can lead to significant gains (or minimized downtime/data loss, etc.) and this is exactly why we (speakers/RDs/MVPs, etc.) do this stuff! &lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="font-size: 10pt; font-family: 'Arial','sans-serif'"&gt;&lt;font face="verdana,geneva"&gt;The long story short is that it does cost you money to go to a conference (or, at least, &lt;em&gt;time &lt;/em&gt;to read blogs, etc.) but what we try to do at events like Connections is distill down the key points into our sessions so that you can [hopefully] apply these techniques immediately. It makes for fast-paced sessions and an information packed week but our conference just ended yesterday and I already have email from it. That&amp;#39;s just really cool!&lt;/font&gt;&lt;/span&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;span style="font-size: 10pt; font-family: 'Arial','sans-serif'"&gt;&lt;font face="verdana,geneva"&gt;So, I know the economy is in a tough state and I know that quantifying the gain of a conference is hard (especially when the cost of the conference is so easy to quantify) but the end result of some of this time away might be more than worthwhile! &lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="font-size: 10pt; font-family: 'Arial','sans-serif'"&gt;&lt;font face="verdana,geneva"&gt;THANKS Jim!&lt;br /&gt;
kt&lt;/font&gt;&lt;/span&gt; 
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=xacIwb2PYGk:q5KFMBHNywI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=xacIwb2PYGk:q5KFMBHNywI:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=xacIwb2PYGk:q5KFMBHNywI:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?i=xacIwb2PYGk:q5KFMBHNywI:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=xacIwb2PYGk:q5KFMBHNywI:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <link>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Good-strategies-excellent-improvements-thanks-Jim!.aspx</link>
      <author>kimberly.nospam@nospam.sqlskills.com (kltripp)</author>
      <comments>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Good-strategies-excellent-improvements-thanks-Jim!.aspx#comment</comments>
      <guid>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=2ee254c2-d647-4711-aa90-f6e98415fe25</guid>
      <pubDate>Fri, 27 Mar 2009 08:47:00 -0700</pubDate>
      <category>Conferences</category>
      <category>Personal</category>
      <dc:publisher>kltripp</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/KIMBERLY/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=2ee254c2-d647-4711-aa90-f6e98415fe25</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/KIMBERLY/trackback.axd?id=2ee254c2-d647-4711-aa90-f6e98415fe25</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Good-strategies-excellent-improvements-thanks-Jim!.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/KIMBERLY/syndication.axd?post=2ee254c2-d647-4711-aa90-f6e98415fe25</wfw:commentRss>
    </item>
  </channel>
</rss>
