<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Never Say Never &#187; Performance</title>
	<atom:link href="http://phelabaum.com/archive/tag/performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://phelabaum.com</link>
	<description>MS SQL Server Development</description>
	<lastBuildDate>Thu, 29 Sep 2011 02:20:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Calculating ROI on Performance Tuning</title>
		<link>http://phelabaum.com/archive/2010/06/calculating-roi-on-performance-tuning/</link>
		<comments>http://phelabaum.com/archive/2010/06/calculating-roi-on-performance-tuning/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 05:09:45 +0000</pubDate>
		<dc:creator>Seth Phelabaum</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Common Problems]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://phelabaum.com/archive/2010/06/calculating-roi-on-performance-tuning/</guid>
		<description><![CDATA[Recently on the SSC forums, someone asked about how to measure the money in an actual dollar figure that they have saved the company with their performance tuning.&#160; I&#8217;ve often struggled with this myself, and so I started thinking about it a bit deeper.&#160; I started to respond in the thread; then decided I was [...]]]></description>
			<content:encoded><![CDATA[<p>Recently on the SSC forums, someone asked about how to measure the money in an actual dollar figure that they have saved the company with their performance tuning.&#160; I&#8217;ve often struggled with this myself, and so I started thinking about it a bit deeper.&#160; I started to respond in the thread; then decided I was going to be a bit too long winded so I moved it here.&#160;&#160; The following are some of my thoughts/opinions on the subject.</p>
<p>I think everyone will agree that it&#8217;s probably not worth the time to optimize a report that runs once a month at 3 AM on a Saturday to go from 10 minutes to 2 minutes.&#160; Most people would also agree that it&#8217;s worth optimizing a query that users have to wait on nonstop all day long to take it from 5 seconds to 2 seconds (or even 4.5 seconds depending on the amount of time it&#8217;d take to accomplish that change, 10% is still pretty huge for something being used constantly).&#160; For the latter, you can probably take the improvement percentage and multiply it by the salaries of all those affected and come up with a number&#8230; but is it fair to assume that that number goes straight to you? </p>
<p>Let&#8217;s take a data entry process for an example.&#160; We&#8217;ll say we have employees doing data entry and 50% of their time is spent entering things that rely on a stored procedure that takes 5 seconds to run.&#160; You improve that SP to run in 1s.&#160; While this is obviously an improvement, is it fair to take 80% of 50% of their pay and attribute it to your performance savings?&#160; I&#8217;d say not.&#160; For one thing, you have the keying in of the information before they hit save and wait on the query.&#160; Let&#8217;s say they spend half their time typing and half of it waiting on that query to run.&#160; We&#8217;re now talking about 80% of 25%.&#160; Then, factor in the rest of the process.&#160; Perhaps that 5 seconds that they spend &#8216;waiting&#8217; is really spent flipping to the next page of their data or tabbing to some other application which it takes them 3 seconds to do anyways.&#160; Now you&#8217;re only talking about 40% of 25%.&#160; </p>
<p>At the very least, you can *guess* at what number you saved there.&#160; The numbers are a lot harder to get for anything that users don&#8217;t directly wait on.&#160; A few examples of these types of queries might be: </p>
<p>Agent Jobs that run constantly throughout the day   <br />Pre-aggregated reports or data tables that run periodically and store that data for on demand usage    <br />Processes that take only milliseconds but might perform more reads or writes than necessary but are run hundreds of thousands of times a day. </p>
<p>Is there any direct ROI on improving these things?&#160; Maybe&#8230; maybe not.&#160; If that process that takes a few milliseconds but runs constantly takes more locks than it truly needs, it could lead to slowing everything else down by fractional amounts or cause blocking/deadlocking issues in your database that &#8216;freeze&#8217; users and force them to wait, thus wasting time and money.&#160; However, maybe it never would have gotten to that point.&#160; If you weren&#8217;t proactive with fixing that because it wasn&#8217;t causing any problems right now, it could end up costing the company tens or hundreds of thousands of dollars in lost productivity if and when it DID become a problem.&#160; You could measure that.&#160; But is it fair to measure it if you addressed the issue preemptively and it never happened?&#160; How do you come up with a number in this case?&#160; How do you decide what to count *for* yourself and what to count against yourself?&#160; </p>
<p>Going a completely different route, let&#8217;s look at bug fixing.&#160; Let&#8217;s say you identify a loophole in the invoicing process that only applies to .05% of invoices because of the rare criteria.&#160; Maybe that loophole only cost you a few hundred dollars for the 2 years it has existed, but it *could* have cost you thousands depending on which line items it happened to affect.&#160; Do you count the hundreds of dollars it already cost you, or the thousands of dollars it would have eventually cost? </p>
<p>Then you have the customers to take into account on things like a public facing website.&#160; This is also nearly impossible to measure.&#160; If your web queries are all inefficient and slow, it might make your website feel sluggish, unresponsive or broken.&#160; Your queries could also have bugs that return errors to the customers.&#160; Addressing either of these things is obviously going to improve your customers&#8217; experience while browsing your website, but how do you convert that into a physical dollar amount?&#160; Can you claim a percentage of the revenue from that customer because you improved their web viewing experience?&#160; I doubt the sales team would agree with whatever percentage you thought should be attributed to IT/development.&#160; What about additional features on the website that are the deciding factor in getting new customers?&#160; In most cases customers aren&#8217;t going to come right out and say &quot;You know, I was really on the fence about which company to go with, but seeing that I could just check my ___ on your website really made me choose you.&quot;&#160; </p>
<p>At the end of the day, if you really want to calculate a dollar value of the things you&#8217;ve done, I think you have to break things down to a very low level.&#160; Create a range for each thing you fix, improve or create and have that range readily available.&#160; Then when someone asks, you can present your numbers with a range for each item and they can make up their own mind at what is fair.&#160; </p>
<p>Unfortunately, most companies view IT/Development as a &#8216;necessary evil&#8217; that doesn&#8217;t produce anything.&#160; These numbers probably aren&#8217;t going to change their minds, but you should at least be able to keep the focus on &#8216;necessary&#8217; and off of &#8216;evil&#8217;.&#160; The irony is that just about everything work related you do potentially saves or makes the company money in some manner&#8230; everything except sitting around trying to calculate how much money you&#8217;ve saved them.</p>
]]></content:encoded>
			<wfw:commentRss>http://phelabaum.com/archive/2010/06/calculating-roi-on-performance-tuning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create Indexes from the Missing Indexes DMV</title>
		<link>http://phelabaum.com/archive/2010/05/create-indexes-from-the-missing-indexes-dmv/</link>
		<comments>http://phelabaum.com/archive/2010/05/create-indexes-from-the-missing-indexes-dmv/#comments</comments>
		<pubDate>Mon, 24 May 2010 15:43:01 +0000</pubDate>
		<dc:creator>Seth Phelabaum</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[DMV's]]></category>
		<category><![CDATA[Indexes]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[T-SQL]]></category>

		<guid isPermaLink="false">http://phelabaum.com/archive/2010/05/create-indexes-from-the-missing-indexes-dmv/</guid>
		<description><![CDATA[Glenn Berry (Blog) writes a lot of queries to extract information from the system DMV’s.&#160; One of them in particular I found extremely helpful in fixing some of the issues in my system.&#160; I took his query (the CTE at the top) and added some text manipulation to actually generate the create statements for you [...]]]></description>
			<content:encoded><![CDATA[<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: gray; font-size: 10pt; mso-no-proof: yes"><font color="#000000" face="Calibri">Glenn Berry (<a href="http://glennberrysqlperformance.spaces.live.com" target="_blank">Blog</a>) writes a lot of queries to extract information from the system DMV’s.&#160; One of them in particular I found extremely helpful in fixing some of the issues in my system.&#160; I took his query (the CTE at the top) and added some text manipulation to actually generate the create statements for you to save you some time.&#160; I had much grander plans for this, but unfortunately I’ve been meaning to post this for over a month now and simply haven’t had time to get back to it, so rather than just let it go by the wayside and never post it, I figured I’d just post what I had now and then possibly post an update sometime in the future if I ever finish it.&#160; </font></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: gray; font-size: 10pt; mso-no-proof: yes"><font color="#000000" size="2" face="Calibri"></font></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: gray; font-size: 10pt; mso-no-proof: yes"><font color="#000000" face="Calibri">A couple of the known problems right now are:&#160; </font></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: gray; font-size: 10pt; mso-no-proof: yes"><font color="#000000" size="2" face="Calibri"></font></span></p>
<ul>
<li>
<div style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: gray; font-size: 10pt; mso-no-proof: yes"><font color="#000000" face="Calibri">Index names could already be taken, there’s nothing here that checks to make sure they are unique based on other indexes in your database.</font></span></div>
</li>
<li>
<div style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: gray; font-size: 10pt; mso-no-proof: yes"><font color="#000000" face="Calibri">No compression options are taken into account.</font></span></div>
</li>
</ul>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: gray; font-size: 10pt; mso-no-proof: yes"><font color="#000000" size="2" face="Calibri"></font></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: gray; font-size: 10pt; mso-no-proof: yes"><font color="#000000" face="Calibri">That said, I still found this fairly useful and hopefully somebody else will as well.&#160; Thanks again to Glenn for all his excellent work at creating queries to pull information from the DMV’s.</font></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: gray; font-size: 10pt; mso-no-proof: yes"></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: gray; font-size: 10pt; mso-no-proof: yes">;</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes">WITH</span><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"> I <span style="color: blue">AS </span><span style="color: gray">(
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: green; font-size: 10pt; mso-no-proof: yes">&#8211; Missing Indexes current database by Index Advantage
</p>
<p>   </span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: green; font-size: 10pt; mso-no-proof: yes">&#8211; This DMV Query written by Glenn Berry
</p>
<p>   </span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes">SELECT</span><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"> user_seeks <span style="color: gray">*</span> avg_total_user_cost <span style="color: gray">*</span>
</p>
<p>   </span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span></span><span style="font-family: &quot;Courier New&quot;; color: gray; font-size: 10pt; mso-no-proof: yes">(</span><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes">avg_user_impact <span style="color: gray">*</span> <span style="color: #ff8000">0.01</span><span style="color: gray">)</span> <span style="color: blue">AS</span> [index_advantage]<span style="color: gray">,</span>
</p>
<p>   </span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes">migs<span style="color: gray">.</span>last_user_seek<span style="color: gray">,</span>
</p>
<p>   </span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes">mid<span style="color: gray">.</span>[statement] <span style="color: blue">AS</span> [Database.Schema.Table]<span style="color: gray">,
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes">mid<span style="color: gray">.</span>equality_columns<span style="color: gray">,</span> mid<span style="color: gray">.</span>inequality_columns<span style="color: gray">,</span>
</p>
<p>   </span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes">mid<span style="color: gray">.</span>included_columns<span style="color: gray">,</span>migs<span style="color: gray">.</span>unique_compiles<span style="color: gray">,</span> migs<span style="color: gray">.</span>user_seeks<span style="color: gray">,</span>
</p>
<p>   </span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes">migs<span style="color: gray">.</span>avg_total_user_cost<span style="color: gray">,</span> migs<span style="color: gray">.</span>avg_user_impact
</p>
<p>   </span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes">FROM</span><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"> <span style="color: green">sys</span><span style="color: gray">.</span><span style="color: green">dm_db_missing_index_group_stats</span> <span style="color: blue">AS</span> migs <span style="color: blue">WITH </span><span style="color: gray">(</span><span style="color: blue">NOLOCK</span><span style="color: gray">)
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: gray; font-size: 10pt; mso-no-proof: yes">INNER</span><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"> <span style="color: gray">JOIN</span> <span style="color: green">sys</span><span style="color: gray">.</span><span style="color: green">dm_db_missing_index_groups</span> <span style="color: blue">AS</span> mig <span style="color: blue">WITH </span><span style="color: gray">(</span><span style="color: blue">NOLOCK</span><span style="color: gray">)
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes">ON</span><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"> migs<span style="color: gray">.</span>group_handle <span style="color: gray">=</span> mig<span style="color: gray">.</span>index_group_handle
</p>
<p>   </span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: gray; font-size: 10pt; mso-no-proof: yes">INNER</span><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"> <span style="color: gray">JOIN</span> <span style="color: green">sys</span><span style="color: gray">.</span><span style="color: green">dm_db_missing_index_details</span> <span style="color: blue">AS</span> mid <span style="color: blue">WITH </span><span style="color: gray">(</span><span style="color: blue">NOLOCK</span><span style="color: gray">)
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes">ON</span><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"> mig<span style="color: gray">.</span>index_handle <span style="color: gray">=</span> mid<span style="color: gray">.</span>index_handle
</p>
<p>   </span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes">WHERE</span><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"> mid<span style="color: gray">.</span>database_id <span style="color: gray">=</span> <span style="color: fuchsia">DB_ID</span><span style="color: gray">()</span>
</p>
<p>   </span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span><span style="color: gray">AND</span> user_seeks <span style="color: gray">*</span> avg_total_user_cost <span style="color: gray">*</span>
</p>
<p>   </span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span></span><span style="font-family: &quot;Courier New&quot;; color: gray; font-size: 10pt; mso-no-proof: yes">(</span><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes">avg_user_impact <span style="color: gray">*</span> <span style="color: #ff8000">0.01</span><span style="color: gray">)</span> <span style="color: gray">&gt;</span> <span style="color: #ff8000">9000</span> <span style="color: green">&#8211; Set this to Whatever
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: gray; font-size: 10pt; mso-no-proof: yes">)
</p>
<p>   </span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: gray; font-size: 10pt; mso-no-proof: yes">
<p>&#160;</p>
<p>   </span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes">SELECT</span><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"> <span style="color: red">&#8216;CREATE INDEX IX_&#8217;
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 2">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: gray">+</span> <span style="color: fuchsia">SUBSTRING</span><span style="color: gray">(</span>[Database.Schema.Table]<span style="color: gray">,
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 5">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: fuchsia">CHARINDEX</span><span style="color: gray">(</span><span style="color: red">&#8216;].['</span><span style="color: gray">,</span>[Database.Schema.Table]<span style="color: gray">,
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 5">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: fuchsia">CHARINDEX</span><span style="color: gray">(</span><span style="color: red">&#8216;].['</span><span style="color: gray">,</span>[Database.Schema.Table]<span style="color: gray">)+</span><span style="color: #ff8000">4</span><span style="color: gray">)+</span><span style="color: #ff8000">3</span><span style="color: gray">,
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 5">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: fuchsia">LEN</span><span style="color: gray">(</span>[Database.Schema.Table]<span style="color: gray">)</span> <span style="color: gray">-</span><span style="mso-spacerun: yes">&#160; </span>
</p>
<p>   </span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 5">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="font-family: &quot;Courier New&quot;; color: gray; font-size: 10pt; mso-no-proof: yes">(</span><span style="font-family: &quot;Courier New&quot;; color: fuchsia; font-size: 10pt; mso-no-proof: yes">CHARINDEX</span><span style="font-family: &quot;Courier New&quot;; color: gray; font-size: 10pt; mso-no-proof: yes">(</span><span style="font-family: &quot;Courier New&quot;; color: red; font-size: 10pt; mso-no-proof: yes">&#8216;].['</span><span style="font-family: &quot;Courier New&quot;; color: gray; font-size: 10pt; mso-no-proof: yes">,</span><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes">[Database.Schema.Table]<span style="color: gray">,
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 5">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: fuchsia">CHARINDEX</span><span style="color: gray">(</span><span style="color: red">&#8216;].['</span><span style="color: gray">,</span>[Database.Schema.Table]<span style="color: gray">)+</span><span style="color: #ff8000">4</span><span style="color: gray">)+</span><span style="color: #ff8000">3</span><span style="color: gray">))
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 2">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: gray">+</span> <span style="color: red">&#8216;_&#8217;</span> <span style="color: gray">+</span> <span style="color: gray">LEFT(</span><span style="color: fuchsia">REPLACE</span><span style="color: gray">(</span><span style="color: fuchsia">REPLACE</span><span style="color: gray">(</span><span style="color: fuchsia">REPLACE</span><span style="color: gray">(</span><span style="color: fuchsia">REPLACE</span><span style="color: gray">(
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 2">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: fuchsia">ISNULL</span><span style="color: gray">(</span>Equality_Columns<span style="color: gray">,</span>inequality_columns<span style="color: gray">),
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 2">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: red">&#8216;['</span><span style="color: gray">,</span><span style="color: red">''</span><span style="color: gray">),</span><span style="color: red">']&#8216;</span><span style="color: gray">,</span><span style="color: red">&#8221;</span><span style="color: gray">),</span><span style="color: red">&#8216; &#8216;</span><span style="color: gray">,</span><span style="color: red">&#8221;</span><span style="color: gray">),</span><span style="color: red">&#8216;,&#8217;</span><span style="color: gray">,</span><span style="color: red">&#8221;</span><span style="color: gray">),</span><span style="color: #ff8000">20</span><span style="color: gray">)
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 2">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: gray">+</span> <span style="color: red">&#8216; ON &#8216;
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 2">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: gray">+</span> [Database.Schema.Table]
</p>
<p>   </span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 2">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: gray">+</span> <span style="color: red">&#8216;(&#8216;
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 2">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: gray">+</span> <span style="color: fuchsia">ISNULL</span><span style="color: gray">(</span>equality_columns<span style="color: gray">,</span><span style="color: red">&#8221;</span><span style="color: gray">)
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 2">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: gray">+</span> <span style="color: blue">CASE</span> <span style="color: blue">WHEN</span> equality_columns <span style="color: gray">IS</span> <span style="color: gray">NOT</span> <span style="color: gray">NULL</span> <span style="color: gray">AND</span>
</p>
<p>   </span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 5">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>inequality_columns <span style="color: gray">IS</span> <span style="color: gray">NOT</span> <span style="color: gray">NULL</span>
</p>
<p>   </span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 3">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: blue">THEN</span> <span style="color: red">&#8216;,&#8217;</span>
</p>
<p>   </span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 3">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: blue">ELSE</span> <span style="color: red">&#8221;</span>
</p>
<p>   </span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 2">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="mso-spacerun: yes">&#160; </span><span style="color: blue">END
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 2">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: gray">+</span> <span style="color: fuchsia">ISNULL</span><span style="color: gray">(</span>inequality_columns<span style="color: gray">,</span><span style="color: red">&#8221;</span><span style="color: gray">)
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 2">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: gray">+</span> <span style="color: red">&#8216;)&#8217;
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 2">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: gray">+</span> <span style="color: blue">CASE</span> <span style="color: blue">WHEN</span> included_columns <span style="color: gray">IS</span> <span style="color: gray">NOT</span> <span style="color: gray">NULL</span>
</p>
<p>   </span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 3">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: blue">THEN</span> <span style="color: red">&#8216; INCLUDE(&#8216;</span> <span style="color: gray">+</span> included_columns <span style="color: gray">+</span> <span style="color: red">&#8216;)&#8217;
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 3">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: blue">ELSE</span> <span style="color: red">&#8221;
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 2">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="mso-spacerun: yes">&#160; </span><span style="color: blue">END</span> CreateStatement<span style="color: gray">,
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 2">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: red">&#8216;IX_&#8217;
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 2">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: gray">+</span> <span style="color: fuchsia">SUBSTRING</span><span style="color: gray">(</span>[Database.Schema.Table]<span style="color: gray">,
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 5">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: fuchsia">CHARINDEX</span><span style="color: gray">(</span><span style="color: red">&#8216;].['</span><span style="color: gray">,</span>[Database.Schema.Table]<span style="color: gray">,
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 5">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: fuchsia">CHARINDEX</span><span style="color: gray">(</span><span style="color: red">&#8216;].['</span><span style="color: gray">,</span>[Database.Schema.Table]<span style="color: gray">)+</span><span style="color: #ff8000">4</span><span style="color: gray">)+</span><span style="color: #ff8000">3</span><span style="color: gray">,
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 5">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: fuchsia">LEN</span><span style="color: gray">(</span>[Database.Schema.Table]<span style="color: gray">)</span> <span style="color: gray">-</span><span style="mso-spacerun: yes">&#160; </span>
</p>
<p>   </span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 5">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="font-family: &quot;Courier New&quot;; color: gray; font-size: 10pt; mso-no-proof: yes">(</span><span style="font-family: &quot;Courier New&quot;; color: fuchsia; font-size: 10pt; mso-no-proof: yes">CHARINDEX</span><span style="font-family: &quot;Courier New&quot;; color: gray; font-size: 10pt; mso-no-proof: yes">(</span><span style="font-family: &quot;Courier New&quot;; color: red; font-size: 10pt; mso-no-proof: yes">&#8216;].['</span><span style="font-family: &quot;Courier New&quot;; color: gray; font-size: 10pt; mso-no-proof: yes">,</span><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes">[Database.Schema.Table]<span style="color: gray">,
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 5">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: fuchsia">CHARINDEX</span><span style="color: gray">(</span><span style="color: red">&#8216;].['</span><span style="color: gray">,</span>[Database.Schema.Table]<span style="color: gray">)+</span><span style="color: #ff8000">4</span><span style="color: gray">)+</span><span style="color: #ff8000">3</span><span style="color: gray">))
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 2">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: gray">+</span> <span style="color: red">&#8216;_&#8217;</span> <span style="color: gray">+</span> <span style="color: gray">LEFT(</span><span style="color: fuchsia">REPLACE</span><span style="color: gray">(</span><span style="color: fuchsia">REPLACE</span><span style="color: gray">(</span><span style="color: fuchsia">REPLACE</span><span style="color: gray">(</span><span style="color: fuchsia">REPLACE</span><span style="color: gray">(
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 2">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: fuchsia">ISNULL</span><span style="color: gray">(</span>Equality_Columns<span style="color: gray">,</span>inequality_columns<span style="color: gray">),
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 2">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: red">&#8216;['</span><span style="color: gray">,</span><span style="color: red">''</span><span style="color: gray">),</span><span style="color: red">']&#8216;</span><span style="color: gray">,</span><span style="color: red">&#8221;</span><span style="color: gray">),</span><span style="color: red">&#8216; &#8216;</span><span style="color: gray">,</span><span style="color: red">&#8221;</span><span style="color: gray">),</span><span style="color: red">&#8216;,&#8217;</span><span style="color: gray">,</span><span style="color: red">&#8221;</span><span style="color: gray">),</span><span style="color: #ff8000">20</span><span style="color: gray">)
</p>
<p>     </span></span></p>
<p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 3">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>IndexName
</p>
<p>   </span></p>
<p class="MsoNormal"><span style="line-height: 115%; font-family: &quot;Courier New&quot;; color: blue; font-size: 10pt; mso-no-proof: yes">FROM</span><span style="line-height: 115%; font-family: &quot;Courier New&quot;; font-size: 10pt; mso-no-proof: yes"> I</span></p>
]]></content:encoded>
			<wfw:commentRss>http://phelabaum.com/archive/2010/05/create-indexes-from-the-missing-indexes-dmv/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>2008 Upgrade Completed</title>
		<link>http://phelabaum.com/archive/2010/04/2008-upgrade-completed/</link>
		<comments>http://phelabaum.com/archive/2010/04/2008-upgrade-completed/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 15:20:08 +0000</pubDate>
		<dc:creator>Seth Phelabaum</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://phelabaum.com/archive/2010/04/2008-upgrade-completed/</guid>
		<description><![CDATA[Whew!  So I&#8217;ve been super busy the past week and a half upgrading our production server from SQL 2000 to SQL 2008 and haven&#8217;t had time for any new posts.  Finally starting to see everything calm down again though and running smoother than ever before.  I had hoped to do a comparison of 2000 and [...]]]></description>
			<content:encoded><![CDATA[<p>Whew!  So I&#8217;ve been super busy the past week and a half upgrading our production server from SQL 2000 to SQL 2008 and haven&#8217;t had time for any new posts.  Finally starting to see everything calm down again though and running smoother than ever before.  I had hoped to do a comparison of 2000 and 2008 disk activity pre and post compression, but due to the number of &#8220;emergencies&#8221; in the week prior to the changeover and the number of times our plans changed with reconfiguring raid arrays etc. I never had an opportunity to get good solid numbers.  I can report a very rough estimate though.</p>
<p>The compression on my objects is distributed as:</p>
<table border="0" cellspacing="0" cellpadding="2" width="167">
<tbody>
<tr>
<td width="94" valign="top">Type</td>
<td width="71" valign="top">#</td>
</tr>
<tr>
<td width="94" valign="top">None</td>
<td width="71" valign="top">2042</td>
</tr>
<tr>
<td width="94" valign="top">Row</td>
<td width="71" valign="top">107</td>
</tr>
<tr>
<td width="94" valign="top">Page</td>
<td width="71" valign="top">549</td>
</tr>
</tbody>
</table>
<ul>
<li>Our database went from 75g to about 30g after a good amount of page compression.</li>
<li>Our CPU Usage hasn&#8217;t gone up that I&#8217;ve noticed.  I haven&#8217;t seen it break 30% total utilization yet.  If it did go up, it didn&#8217;t go up enough to become a bottleneck.</li>
<li>Many of the queries are running significantly faster and I haven&#8217;t really seen any decrease on any others.</li>
<li>Our disk usage has gone down significantly.</li>
<li>Our page life expectancy has gone through the roof.  Before we averaged around 6000 and would occasionally drop down to under 2000 or even down to 0, now we&#8217;re averaging upwards of 150,000.</li>
<li>Average Disk Queue Length post upgrade is around .1 for both data and tempdb arrays.</li>
</ul>
<p><a href="http://phelabaum.com/wp-content/uploads/2010/04/Proc.jpg"><img style="display: inline; border-width: 0px;" title="Proc" src="http://phelabaum.com/wp-content/uploads/2010/04/Proc_thumb.jpg" border="0" alt="Proc" width="285" height="77" /></a> <a href="http://phelabaum.com/wp-content/uploads/2010/04/PLE.jpg"><img style="display: inline; border-width: 0px;" title="PLE" src="http://phelabaum.com/wp-content/uploads/2010/04/PLE_thumb.jpg" border="0" alt="PLE" width="309" height="44" /></a></p>
<p>I will admit that I built a few additional indexes on this database with the help of some of the new DMV&#8217;s in 2008(More on this in my next post), but that didn&#8217;t account for the bulk of this change.</p>
<p>Overall the upgrade went fairly smooth.  Here are a few notes about things that I had to fix during the upgrade process.</p>
<p>Check your identity values after backup and restore from 2k -&gt; 2k8.  I used this little script to do it.  You&#8217;ll get a lot of errors for tables that don&#8217;t have identity columns but you can just ignore them.</p>
<pre class="brush:sql">exec sp_msforeachtable 'DBCC CHECKIDENT("?")'</pre>
<p>Beware temp table creation with nullable columns.</p>
<p>Somewhere between sql 2000 and sql 2008 the nullability properties of temp table columns changed.  If you do something like:</p>
<pre class="brush:sql">SELECT *
INTO #1
FROM YourTable
WHERE 1=2</pre>
<p>You won&#8217;t necessarily get the same temp table in SQL 2000 vs sql 2008.  In SQL 2000, more of those columns might have been nullable.  In SQL 2008, it properly pulls the nullability from the base table.  One of ways you used to be able to force this in 2000 is to wrap a COALESCE(yourcolumn,NULL) around the column you need to be nullable in the creation.  That has been hit or miss in 2008.  I wouldn&#8217;t rely on it and would really advise just building the table properly and not using SELECT INTO to create your table.</p>
<p>Very similar to this, I&#8217;ve seen things that were working fine with hard coded values that you intend to fill in later fail in 2008 that worked in 2000.  For example,</p>
<pre class="brush:sql">SELECT 	Field1,
		0 IntToBeCalculatedLater
		Field3
INTO #1
FROM MyTable</pre>
<p>In my testing I can&#8217;t duplicate one that works in 2000 and not in 2008, but I&#8217;ve had stored procedures start failing in my database because of this, so apparently it can happen.  Note that you can use something like CAST(0 as int) or CAST(NULL as int) instead of just putting 0 there and it will make the column nullable.</p>
]]></content:encoded>
			<wfw:commentRss>http://phelabaum.com/archive/2010/04/2008-upgrade-completed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

