<?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>SQLRockstar &#124; Thomas LaRock &#187; MSSQL</title>
	<atom:link href="http://thomaslarock.com/category/mssql/feed/" rel="self" type="application/rss+xml" />
	<link>http://thomaslarock.com</link>
	<description></description>
	<lastBuildDate>Wed, 23 May 2012 14:15:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Predictive Analysis: I Bet You Didn&#8217;t Know I Would Blog This Today</title>
		<link>http://thomaslarock.com/2012/05/predictive-analysis/</link>
		<comments>http://thomaslarock.com/2012/05/predictive-analysis/#comments</comments>
		<pubDate>Wed, 23 May 2012 14:15:38 +0000</pubDate>
		<dc:creator>sqlrockstar</dc:creator>
				<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[SQL MVP]]></category>
		<category><![CDATA[SQLServerPedia Wiki]]></category>
		<category><![CDATA[BI]]></category>
		<category><![CDATA[Data Mining]]></category>
		<category><![CDATA[Predictive analytics]]></category>
		<category><![CDATA[SQL 2008]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[Statistics]]></category>

		<guid isPermaLink="false">http://sqlbatman.com/?p=1827</guid>
		<description><![CDATA[Quick question: Where would you go to find some basil in your local grocery store? Did you say &#8220;by the other herbs?&#8221; Or did you say &#8220;by the tomatoes?&#8221; If you are like me, then you would go looking for basil by the other herbs because, well, that is a natural, logical grouping of products. [...]<p><p></p>
<a href="http://thomaslarock.com/2012/05/predictive-analysis/">Predictive Analysis: I Bet You Didn&#8217;t Know I Would Blog This Today</a> is a post from: <a href="http://thomaslarock.com">SQLRockstar | Thomas LaRock</a>
<p></p>
</p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a href="http://thomaslarock.com/2012/05/predictive-analysis/reasoning_lg/" rel="attachment wp-att-8683"><img class="alignleft  wp-image-8683" title="It's all bullshit." src="http://thomaslarock.com/wp-content/uploads/2012/05/reasoning_lg-570x460.jpg?9d7bd4" alt="It's all bullshit." width="365" height="294" /></a>Quick question: Where would you go to find some basil in your local grocery store? Did you say &#8220;by the other herbs?&#8221; Or did you say &#8220;by the tomatoes?&#8221; If you are like me, then you would go looking for basil by the other herbs because, well, <strong>that is a natural, logical grouping of products.</strong> However, since many people tend to associate basil and tomatoes together, like for a pasta sauce, then some stores may locate basil there instead. Many stores will do both, but some stores that are short on shelf space could decide one over the other.</p>
<p>So, I was &#8220;that guy&#8221;. Yeah, the one in a million that might actually need basil for a recipe that did not call for tomatoes. So, I went to the section where all the herbs are located and did not find any basil. I then had to report back to Congress that I had failed, that the mission was not accomplished, and we went ahead with dinner plans even though we knew that our meal was not going to be complete.</p>
<p>Why am I telling you this? Good question. Any other questions?</p>
<p>You will hear parts of business intelligence (or business analytics) that are called &#8220;Predictive Analysis&#8221;. An example of this is the business of product placement in grocery stores, such as basil and tomatoes. When enough people buy things together, stores will start to associate products and group them in displays. Hey, it makes sense, and I doubt the idea of basil and tomatoes being located together is anything new that required a 1.7TB cube to be processed in Excel for some grocery executive. But what is interesting is the idea that you can examine (what they call &#8220;data mining&#8221;) your data to look for trends so that you can predict the likelihood of future events.</p>
<p>Which is where I call bullshit.</p>
<p>See, I have worked off and on in the financial world for over fifteen years now. And there is one thing you learn right at the start, and that is this:</p>
<p><strong>Past performance does not guarantee future results.</strong></p>
<p>In other words, <span style="text-decoration: underline;"><em>you cannot predict the future</em></span>. Yet the title &#8220;Predictive Analysis&#8221; would lead to you to believe otherwise. There are thousands of business leaders out there right now, many of them in the financial world, that think if they have enough data they can predict the future. And that is just not true. Take my case for example, I just wanted basil. Sure, perhaps you could argue that I fell outside of your 95% confidence interval, and that outliers will always exist, and that your models work a majority of the time. But the end result is the same, you cannot predict events no matter if you have a crapload of data at your disposal or not. [I think some folks like to just stop and call that "free will".]
<p>When I was participating in Six Sigma training we spent considerable time on a section called, quite simply, statistical analysis. As near as I can tell, there is little difference between regular statistical analysis and predictive analysis except for (1) the names and (2) the idea that someone wants you to believe that you can predict the future. In fairness, I can provide you two examples of where I see what could be a reasonable case made for the use of predictive analysis. One is Amazon, and the other is Netflix. Both services do a great job in trying to sell you additional products based upon either your recent selections or the selections of other people that made similar choices. If you want to call this predictive analysis, fine. I call it suggestive selling, based upon statistical analysis, but perhaps that is because I understand you cannot predict the future.</p>
<p>Need another example? Well, check out my <a href="http://thomaslarock.com/book-reviews/" target="_blank">library bookshelf</a>. I started placing reference books onto my site, and yes they link back to Amazon. If someone stops by and orders a book I get roughly a dollar for providing the link. Not big money, and no I am not looking to get rich, I just wanted to buy a cup of coffee every now and then. So, in less than a week, no books have been sold, which is to be expected. But what was not expected was the fact that someone decided to browse Amazon a little bit and ended up buying <a href="http://www.amazon.com/gp/product/B00005M1WE?ie=UTF8&amp;tag=sq0f-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B00005M1WE">this</a>.</p>
<p>Yeah. And I want to see the analysis that predicted that correlation between that and a book on SQL 2008.</p>
<p>Want to go one step further? How about the fact that most companies compare results to previous quarters and years? How ridiculous is it that you would compare your Q1 results to the previous year, without any other information? Or to compare the results from one region to another? You simply cannot make important decisions on such information without a consideration of all the external factors.</p>
<p>&#8220;<em>There are three kinds of lies: lies, damned lies, and statistics.</em>&#8221; <em> -</em>Benjamin Disraeli</p>
<p><p></p>
<a href="http://thomaslarock.com/2012/05/predictive-analysis/">Predictive Analysis: I Bet You Didn&#8217;t Know I Would Blog This Today</a> is a post from: <a href="http://thomaslarock.com">SQLRockstar | Thomas LaRock</a>
<p></p>
</p>
<div class="shr-publisher-1827"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://thomaslarock.com/2012/05/predictive-analysis/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How To Find Long Running Backups in SQL Server</title>
		<link>http://thomaslarock.com/2012/05/how-to-find-long-running-backups-in-sql-server/</link>
		<comments>http://thomaslarock.com/2012/05/how-to-find-long-running-backups-in-sql-server/#comments</comments>
		<pubDate>Tue, 22 May 2012 14:55:52 +0000</pubDate>
		<dc:creator>sqlrockstar</dc:creator>
				<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[Six Sigma]]></category>
		<category><![CDATA[SQL MVP]]></category>
		<category><![CDATA[SQL Server Performance]]></category>
		<category><![CDATA[SQLServerPedia Wiki]]></category>
		<category><![CDATA[backups]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[sql 2012. backupset]]></category>

		<guid isPermaLink="false">http://thomaslarock.com/?p=8662</guid>
		<description><![CDATA[I&#8217;ve written before about how much I love looking for outliers. One example of this can be found in the post I did on the sysjobhistory table. Recently I was asked to put together some code to find out which backups were &#8220;running long&#8221;. Of course my first question was trying to define what was [...]<p><p></p>
<a href="http://thomaslarock.com/2012/05/how-to-find-long-running-backups-in-sql-server/">How To Find Long Running Backups in SQL Server</a> is a post from: <a href="http://thomaslarock.com">SQLRockstar | Thomas LaRock</a>
<p></p>
</p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a href="http://thomaslarock.com/2012/05/how-to-find-long-running-backups-in-sql-server/normal/" rel="attachment wp-att-8670"><img class="alignleft  wp-image-8670" title="normal" src="http://thomaslarock.com/wp-content/uploads/2012/05/normal.jpg?9d7bd4" alt="Normal distribution" width="360" height="258" /></a>I&#8217;ve written before about how much I love looking for outliers. One example of this can be found <a href="http://thomaslarock.com/2011/04/march-madness-sql-server-system-tables-sysjobhistory/" target="_blank">in the post I did on the sysjobhistory table</a>. Recently I was asked to put together some code to find out which backups were &#8220;running long&#8221;. Of course my first question was trying to define what was meant by &#8220;long&#8221;. That&#8217;s when I decided to simply define &#8220;long&#8221; as any time that is <a href="http://www.robertniles.com/stats/stdev.shtml">more than two standard deviations away from the mean</a>.</p>
<p>You can use the following code to help get you those details. I used a CTE, but feel free to modify it however you want. I also included a parameter for the minimum number of seconds you would want included in your evaluation. For example, you may not care about backups that run in two seconds, have a standard deviation of one-half a second, and suddenly one day it takes five seconds. That choice is yours, really, so that is why I included the parameter.</p>
<p>Also worth noting is that the <a href="http://msdn.microsoft.com/en-us/library/ms186299.aspx" target="_blank">backupset table has a column for backup size</a>. In theory you could modify this code to focus on the size of the backup as opposed to the length of time it takes to run. I didn&#8217;t go down that route because I was asked to focus on time, not size (and I have always been told that size doesn&#8217;t matter anyway).</p>
<p>I think the most important lesson here is that you could use code like this to find other outliers. Anything that has an average that can be calculated, really. I&#8217;m thinking about things like query run times, of course&#8230;or even the amount of logical I/O for a query. Yep, just about anything.</p>
<p>&nbsp;</p>
<pre class="language">declare @MinAvgSecsDuration int = 2
;
WITH BackupHistData AS
(
  SELECT database_guid, type, MAX(backup_set_id) AS [MAX_BSID]
	,AVG(CAST(DATEDIFF(s, backup_start_date, backup_finish_date) AS int))
		AS [AVG]
	,STDEVP(CAST(DATEDIFF(s, backup_start_date, backup_finish_date) AS int))
		AS [SIGMA]
	FROM msdb.dbo.backupset
	GROUP BY database_guid, type
)
SELECT bup.database_name, bup.backup_set_id, bup.type
	,CAST(DATEDIFF(s, bup.backup_start_date, bup.backup_finish_date) AS int)
		AS [backup_time_sec]
	,bhd.[AVG] as [avg_sec]
	,(1.0*bhd.[AVG]+2.0*bhd.SIGMA) as [max_duration_sec]
FROM BackupHistData bhd
INNER JOIN msdb.dbo.backupset bup ON bhd.database_guid = bup.database_guid
/*Filter for the outliers*/
WHERE CAST(DATEDIFF(s, bup.backup_start_date, bup.backup_finish_date) AS int) &gt;
			(1.0*bhd.[AVG]+2.0*bhd.SIGMA)
/*Filter for only the most recent backup, if desired*/
AND bup.backup_set_id = bhd.MAX_BSID
/*Filter for backups with an average duration time, if desired*/
AND bhd.[AVG] &gt;= @MinAvgSecsDuration
/*Filter for specific backup types, if desired*/
AND bhd.type IN ('D', 'I', 'L')</pre>
<p>&nbsp;<br />
<strong>DISCLAIMER</strong>: <span style="color: #008000;"><em>Do not run code you find on the internet in your production environment without testing it first. Do not use this code if your vision becomes blurred. Seek medical attention if this code runs longer than four hours. On rare occasions this code has been known to cause one or more of the following: nausea, headaches, high blood pressure, popcorn cravings, and the impulse to reformat tabs into spaces. If this code causes your servers to smoke, seek shelter. Do not taunt this code. </em></span></p>
<p>Good luck.</p>
<p><p></p>
<a href="http://thomaslarock.com/2012/05/how-to-find-long-running-backups-in-sql-server/">How To Find Long Running Backups in SQL Server</a> is a post from: <a href="http://thomaslarock.com">SQLRockstar | Thomas LaRock</a>
<p></p>
</p>
<div class="shr-publisher-8662"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://thomaslarock.com/2012/05/how-to-find-long-running-backups-in-sql-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The 3 DBA Mistakes You Don&#8217;t Know You Are Making</title>
		<link>http://thomaslarock.com/2012/05/the-3-dba-mistakes-you-dont-know-you-are-making/</link>
		<comments>http://thomaslarock.com/2012/05/the-3-dba-mistakes-you-dont-know-you-are-making/#comments</comments>
		<pubDate>Mon, 14 May 2012 19:00:26 +0000</pubDate>
		<dc:creator>sqlrockstar</dc:creator>
				<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[SQL MVP]]></category>
		<category><![CDATA[SQLServerPedia Wiki]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[mistake]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[recovery]]></category>
		<category><![CDATA[sql server]]></category>

		<guid isPermaLink="false">http://thomaslarock.com/?p=8638</guid>
		<description><![CDATA[You have no idea that what you are not doing is causing you pain.
Then again, how could you know this? I mean, if you are not doing it, why would you ever think that your inaction could be the very thing that is causing you heartache every time your phone rings in the middle of [...]<p><p></p>
<a href="http://thomaslarock.com/2012/05/the-3-dba-mistakes-you-dont-know-you-are-making/">The 3 DBA Mistakes You Don&#8217;t Know You Are Making</a> is a post from: <a href="http://thomaslarock.com">SQLRockstar | Thomas LaRock</a>
<p></p>
</p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a href="http://thomaslarock.com/2012/05/the-3-dba-mistakes-you-dont-know-you-are-making/warning-sign/" rel="attachment wp-att-8644"><img class="alignleft size-medium wp-image-8644" title="Warning sign" src="http://thomaslarock.com/wp-content/uploads/2012/05/warning-285x300.jpg?9d7bd4" alt="" width="285" height="300" /></a>You have no idea that what you are not doing is causing you pain.</p>
<p>Then again, how could you know this? I mean, if you are not doing it, why would you ever think that your inaction could be the very thing that is causing you heartache every time your phone rings in the middle of the night?</p>
<p>I see DBAs make these three mistakes repeatedly. But they are not a mistake as you might think of a mistake: a misstep along a specified process. No, these mistakes are brought about because the person simply didn&#8217;t know any better.</p>
<p>But they should.</p>
<p>I&#8217;m hoping by listing them here, it will help.</p>
<h3>1. You Don&#8217;t Have A Recovery Plan</h3>
<p>The number one reason for a DBA to exist is this: recovery. It should be your primary focus each and every day. You need to be able to recover from any event, no matter how big or small. Lose an entire data center? You had better be able to recover that data. Lose a handful of LUNs? You had better be able to recover that data. Someone deletes a table? You had better be able to recover that data.</p>
<p>So why then do I see many DBAs spend time focusing on a good backup strategy but never spend an equal amount of time on a recovery strategy? Of course we know that every good recovery strategy <em>must</em> start with a good backup strategy, but so many DBAs (especially novice ones) never bother to test their restore process. Are your backups written to disk, and then saved off to tape? OK, that&#8217;s fine, now&#8230;quick&#8230;how long will it take to recover that tape? If your end user calls and says they need to recover a database from last week, how long before that request can be completed. Here is a better question: how long before your end user become <strong>very</strong> annoyed that they have to wait any longer?</p>
<p>There is only one way to be certain that the backups you have can even be used for recovery: you need to actually recover them without error to be 100% certain. That&#8217;s why I wrote this <a href="http://www.simple-talk.com/sql/database-administration/statistical-sampling-for-verifying-database-backups/" target="_blank">article for Simple-Talk two years ago on how to use statistical sampling in order to be 95% confident</a> that all your backups are valid.</p>
<p>Taking backups is not even half of what you need to do as a DBA. You need to recover, from a variety of failures, and you need to be able to do it as quickly as possible. Having a plan is good, but practicing that plan is even better.</p>
<h3>2. You Pretend That Virtualization Doesn&#8217;t Matter</h3>
<p>I know that VMWare will tell you that running in a virtual environment <a href="http://www.vmware.com/solutions/business-critical-apps/sql/performance.html" target="_blank">can be up to 99% of the performance</a> you have in a physical environment. I also know that when people see that 99% number they decide that they can shove as many guests onto a VMWare host as space will allow for and they still believe they will have 99% performance for each and every instance. This is especially true if those instances are believed to be &#8220;lightly used&#8221;.</p>
<p>The beauty of running your servers in a virtual environment is that you get to share resources and easily migrate guests between hosts. The ugly truth about running your servers in a virtual environment is that you get to share resources and easily migrate guests between hosts.</p>
<p>As a DBA you are now managing a piece of software that runs inside of a guest O/S that is running on a host, that has a hypervisor, and that likely shares its disks with other hosts as well. What that means is that when someone runs a query, that query has to travel down that stack and back again in order to return a result. Now, if someone comes to you and says that they are having a performance issue what would you do first? Would you look at the query? Or the O/S metrics for that guest? Or something else?</p>
<p>Or would you prefer to <a title="Stop Guessing About CPU Pressure" href="http://thomaslarock.com/2012/01/stop-guessing-about-cpu-pressure/">spend five minutes examining the virtual layer</a> to see if any bottlenecks exist. For example, if the host is seeing a spike in disk latency, then it is likely the guests are seeing disk latency as well. So, how much time would you want to spend trying to make a query faster when the issue has to do with an overloaded disk subsystem? I know what my answer is: none. What if the bottleneck is host CPU saturation? How long will you want to spend trying to tune a query when you already know that the issue is at the host layer?</p>
<p>Pretending that virtualization doesn&#8217;t matter for your database servers is a mistake I see being made by both DBAs and server admins. Those counters hold the key to being efficient at performance tuning in a virtual world. But they are only useful if someone knows to be looking at them.</p>
<h3>3. You Don&#8217;t Configure Memory Settings Properly</h3>
<p>This one drives me crazy.</p>
<p>I still see database servers with the default memory settings. When a customer comes to me and complains about having memory issues one of my first questions is: what are your default settings?  At this point I am shocked when someone <em>doesn&#8217;t</em> say &#8220;we left those alone&#8221;. Configuring your default memory setting is one of the easiest thing any DBA can do and should be part of a standard checklist when rolling out a new instance. Yet it still is not happening.</p>
<p>Things get even trickier with memory in a virtual world, as you are competing with other guests for host memory. You simply must know what your memory requirements are for your database server and then work on securing that memory. The easiest way to do this is to configure those memory settings. Even <a title="Misremembering Memory Settings" href="http://thomaslarock.com/2011/03/misremembering-memory-settings/" target="_blank">I can&#8217;t remember everything</a>, so that&#8217;s why I just reference <a href="http://sqlskills.com/blogs/jonathan/post/How-much-memory-does-my-SQL-Server-actually-need.aspx" target="_blank">this post</a> when I need general guidelines regarding the configuration of the min and max memory settings.</p>
<p>There you go, three things that you are likely not doing today and are also equally likely to be causing you and your end users lots of pain.</p>
<p><p></p>
<a href="http://thomaslarock.com/2012/05/the-3-dba-mistakes-you-dont-know-you-are-making/">The 3 DBA Mistakes You Don&#8217;t Know You Are Making</a> is a post from: <a href="http://thomaslarock.com">SQLRockstar | Thomas LaRock</a>
<p></p>
</p>
<div class="shr-publisher-8638"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://thomaslarock.com/2012/05/the-3-dba-mistakes-you-dont-know-you-are-making/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Are You Using the Right SQL Server Performance Metrics?</title>
		<link>http://thomaslarock.com/2012/05/are-you-using-the-right-sql-server-performance-metrics/</link>
		<comments>http://thomaslarock.com/2012/05/are-you-using-the-right-sql-server-performance-metrics/#comments</comments>
		<pubDate>Tue, 01 May 2012 18:27:08 +0000</pubDate>
		<dc:creator>sqlrockstar</dc:creator>
				<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[SQL MVP]]></category>
		<category><![CDATA[SQL Server Performance]]></category>
		<category><![CDATA[SQLServerPedia Wiki]]></category>
		<category><![CDATA[counters]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[Database administrator]]></category>
		<category><![CDATA[metrics]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://thomaslarock.com/?p=8587</guid>
		<description><![CDATA[No matter what our profession, we all have our favorite set of tools to help us get the job done.
Database Administrators will have a set of scripts that we use in order to gain insight into the server instances under our care. I often see beginner DBAs look to the counters provided by Perfmon (AKA, the Resource and Performance [...]<p><p></p>
<a href="http://thomaslarock.com/2012/05/are-you-using-the-right-sql-server-performance-metrics/">Are You Using the Right SQL Server Performance Metrics?</a> is a post from: <a href="http://thomaslarock.com">SQLRockstar | Thomas LaRock</a>
<p></p>
</p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><div id="attachment_8595" class="wp-caption alignleft" style="width: 293px"><a href="http://thomaslarock.com/2012/05/are-you-using-the-right-sql-server-performance-metrics/cockpit/" rel="attachment wp-att-8595"><img class="size-full wp-image-8595" title="cockpit" src="http://thomaslarock.com/wp-content/uploads/2012/05/cockpit.jpg?9d7bd4" alt="Which one of these orders more bacon?" width="283" height="424" /></a><p class="wp-caption-text">Which one of these orders more bacon?</p></div>
<p>No matter what our profession, we all have our favorite set of tools to help us get the job done.</p>
<p>Database Administrators will have a set of scripts that we use in order to gain insight into the server instances under our care. I often see beginner DBAs look to the counters provided by Perfmon (AKA, the <a href="http://technet.microsoft.com/en-us/library/cc771692(v=ws.10).aspx" target="_blank">Resource and Performance Monitor</a>). The trouble here is the counters themselves don&#8217;t necessarily give you enough details to make an informed decision about what actions you should take next. You need to look at a handful of the counters at any given time (or over a period of time) in order to better ascertain where the bottlenecks exist.</p>
<p>Here is a list of five metrics that I find myself frequently using when troubleshooting performance issues. They help me get insight quickly into some of the deep recesses of SQL Server so that I can easily corroborate with standard Perfmon counters in order to troubleshoot issues for customers. Ideally these are all being collected over a period of time so that you can do some proper trend analysis.</p>
<p>These are the metrics, in no particular order, that you should be using during the first few minutes of analysis. They will help you save time.</p>
<h3>1. Signal Waits Percentage</h3>
<p>This metric has provided the most value personally to me over the years. I started using it four years ago when troubleshooting CPU issues. The instance itself was showing signs of &#8220;slowness&#8221;, but the overall CPU utilization numbers were nominal. I came across <a href="http://msdn.microsoft.com/en-us/library/cc966413.aspx" target="_blank">this article by Tom Davidson</a> and found out that I could calculate the percentage of signal waits to the overall waits in order to understand internal CPU pressure exists. [A "signal" wait means that a session is in the "runnable" queue, waiting for a signal from an available processor.]
<p>I filter out some background tasks for this query as well. The value you want returned here is for no more than 20-25% of your total waits to be signal waits. If you are consistently seeing numbers greater than 20% then you are having internal CPU pressure. You can remedy the situation by reducing the number of sessions (not always likely), increasing the number of available CPUs (also not likely), or reducing the amount of time the queries need to execute (often very likely, and sometimes easily done).</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">SELECT (100.0 * SUM(signal_wait_time_ms)/SUM (wait_time_ms)) AS [SignalWaitPct]
FROM sys.dm_os_wait_stats
WHERE wait_type NOT IN (
'CLR_SEMAPHORE', 'LAZYWRITER_SLEEP', 'RESOURCE_QUEUE', 'SLEEP_TASK',
'SLEEP_SYSTEMTASK', 'SQLTRACE_BUFFER_FLUSH', 'WAITFOR', 'LOGMGR_QUEUE',
'CHECKPOINT_QUEUE', 'REQUEST_FOR_DEADLOCK_SEARCH', 'XE_TIMER_EVENT',
'BROKER_TO_FLUSH', 'BROKER_TASK_STOP', 'CLR_MANUAL_EVENT', 'CLR_AUTO_EVENT',
'DISPATCHER_QUEUE_SEMAPHORE', 'FT_IFTS_SCHEDULER_IDLE_WAIT',
'XE_DISPATCHER_WAIT', 'XE_DISPATCHER_JOIN', 'BROKER_EVENTHANDLER',
'TRACEWRITE', 'FT_IFTSHC_MUTEX', 'SQLTRACE_INCREMENTAL_FLUSH_SLEEP',
'BROKER_RECEIVE_WAITFOR', 'ONDEMAND_TASK_QUEUE', 'DBMIRROR_EVENTS_QUEUE',
'DBMIRRORING_CMD', 'BROKER_TRANSMITTER', 'SQLTRACE_WAIT_ENTRIES',
'SLEEP_BPOOL_FLUSH', 'SQLTRACE_LOCK')
AND wait_time_ms &lt;&gt; 0</pre></div></div>

<h3>2. SQL Compilation Percentage</h3>
<p>Another sneaky performance issue is having a high number of statements being compiled. There happens to be a performance counter for compiles but the counter itself does not have much meaning unless you also know the overall number of batch requests. Rather than look at either of those counters separately what you want to do is look at their ratio.</p>
<p>The recommended percentage for compilations is roughly 10% of the total number of batch requests. The following code will show you the current percentage of compilations to the number of batch requests:</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">SELECT 1.0*cntr_value /
(SELECT 1.0*cntr_value
FROM sys.dm_os_performance_counters
WHERE counter_name = 'Batch Requests/sec')
AS [SQLCompilationPct]
FROM sys.dm_os_performance_counters
WHERE counter_name = 'SQL Compilations/sec'</pre></div></div>

<p>At this point someone usually asks &#8220;what about re-compilations&#8221;? Well, re-compilations should only be roughly 1% of the total number of batch requests, so that code would be like this:</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">SELECT 1.0*cntr_value /
(SELECT 1.0*cntr_value
FROM sys.dm_os_performance_counters
WHERE counter_name = 'Batch Requests/sec')
AS [SQLReCompilationPct]
FROM sys.dm_os_performance_counters
WHERE counter_name = 'SQL Re-Compilations/sec'</pre></div></div>

<h3>3. Page Lookups Percentage</h3>
<p>What I like most about this metric is that it often gives me a hint regarding plan cache bloating without me having to dig through the plan cache itself. I also get insight on the queries hitting the instance, to see if they could use some tuning/indexing as there are likely some inefficient query plans being utilized.</p>
<p>What this metric really shows me is if I have one of two extremes. Either I have a few rather large queries hitting my server, or I have a lot of little queries (probably ad-hoc) hitting my instance and likely leading to some plan cache bloating.</p>
<p>What I want to see here is a value that is less than 100 on average:</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">SELECT 1.0*cntr_value /
(SELECT 1.0*cntr_value
FROM sys.dm_os_performance_counters
WHERE counter_name = 'Batch Requests/sec') 
AS [PageLookupPct]
FROM sys.dm_os_performance_counters
WHERE counter_name = 'Page lookups/sec'</pre></div></div>

<h3>4. Average Task Counts</h3>
<p>I got <a title="Need a SQL diagnostic script? Click here!" href="http://sqlserverperformance.wordpress.com/2012/04/30/sql-server-2008-diagnostic-information-queries-may-2012/" target="_blank">this metric</a> from Glenn Berry (<a href="http://glennberrysqlperformance.spaces.live.com/default.aspx">blog</a> | <a href="http://twitter.com/GlennAlanBerry" target="_blank">@GlennAlanBerry</a>), and I use this one to determine what my system has been busy doing. I like how Glenn always has a brief description for what you want (or don&#8217;t want) to see. In this case it is as follows:</p>
<ul>
<li>Sustained values above 10 suggest further investigation in that area</li>
<li>High Avg Task Counts are often caused by blocking or other resource contention</li>
<li>High Avg Runnable Task Counts are a good sign of CPU pressure</li>
<li>High Avg Pending DiskIO Counts are a sign of disk pressure</li>
</ul>
<p>I can use this one in conjunction with others to get some corroborating evidence as to what is happening under the covers:</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">SELECT AVG(current_tasks_count) AS [Avg Task Count],
AVG(runnable_tasks_count) AS [Avg Runnable Task Count],
AVG(pending_disk_io_count) AS [Avg Pending DiskIO Count]
FROM sys.dm_os_schedulers WITH (NOLOCK)
WHERE scheduler_id &lt; 255 OPTION (RECOMPILE)</pre></div></div>

<h3>5. Buffer Pool I/O Rate</h3>
<p>The most misunderstood counter I see is Page Life Expectancy. I know I used to pay attention as if it meant something. Over time I have come to realize that it is a throwback to days of yore when <a href="http://sqlskills.com/blogs/jonathan/post/Finding-what-queries-in-the-plan-cache-use-a-specific-index.aspx" target="_blank">having 4GB of memory was a really big deal</a>. In other words, its intended purpose no longer has the same value as it once did. It is not totally worthless, however. You just need to know what to do with it.</p>
<p>What you really want to see is the rate at which your pages are being cycled through the buffer pool. The following code returns the &#8220;Buffer Pool Rate&#8221; in MB/sec. I usually look for rates around 20MB/sec as a baseline. Why that number? Because if I have a &#8220;typical&#8221; server with 56GB of RAM available for the buffer pool (thank you, locked pages in memory) and I want to keep my pages around for an hour or so (3600 seconds), then I come up with 56000MB/3600sec, or about 15.5 MB/sec. That&#8217;s why I look for a sustained rate of about 20 on average, and if I have a spike upward from there then I know I am having memory pressure (pressure that might otherwise fail to be seen if I only examine the PLE counter).</p>
<p>Here is the code I use:</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">SELECT (1.0*cntr_value/128) /
(SELECT 1.0*cntr_value
FROM sys.dm_os_performance_counters
WHERE object_name like '%Buffer Manager%'
AND lower(counter_name) = 'Page life expectancy')
AS [BufferPoolRate]
FROM sys.dm_os_performance_counters
WHERE object_name like '%Buffer Manager%'
AND counter_name = 'total pages'</pre></div></div>

<p>You should also be aware that if your server is NUMA aware then you will want to take that into consideration <a href="http://sqlskills.com/BLOGS/PAUL/post/Page-Life-Expectancy-isnt-what-you-think.aspx" target="_blank">whenever you try to use PLE as a performance metric</a>.</p>
<p>There you go, the five metrics I utilize for customers whenever they need my help in solving performance problems. I&#8217;m always looking to add to my toolbox, so if you have a favorite metric you want to share just leave it in the comments below.</p>
<p><p></p>
<a href="http://thomaslarock.com/2012/05/are-you-using-the-right-sql-server-performance-metrics/">Are You Using the Right SQL Server Performance Metrics?</a> is a post from: <a href="http://thomaslarock.com">SQLRockstar | Thomas LaRock</a>
<p></p>
</p>
<div class="shr-publisher-8587"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://thomaslarock.com/2012/05/are-you-using-the-right-sql-server-performance-metrics/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>6 Little Known Things That Can Cause Big Performance Issues</title>
		<link>http://thomaslarock.com/2012/04/6-little-known-thing-that-can-cause-big-performance-issues/</link>
		<comments>http://thomaslarock.com/2012/04/6-little-known-thing-that-can-cause-big-performance-issues/#comments</comments>
		<pubDate>Wed, 25 Apr 2012 12:37:38 +0000</pubDate>
		<dc:creator>sqlrockstar</dc:creator>
				<category><![CDATA[Database Design]]></category>
		<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[SQL MVP]]></category>
		<category><![CDATA[SQL Server Performance]]></category>
		<category><![CDATA[SQLServerPedia Wiki]]></category>
		<category><![CDATA[CPU]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[power]]></category>
		<category><![CDATA[reporting]]></category>
		<category><![CDATA[savings]]></category>

		<guid isPermaLink="false">http://thomaslarock.com/?p=8533</guid>
		<description><![CDATA[As a system admin, DBA, or a developer it is our job to root out performance problems quickly. The trouble is that there are so many things that can cause performance issues it can be difficult to know every possible root cause. This is especially true when the root cause lies somewhere outside your area [...]<p><p></p>
<a href="http://thomaslarock.com/2012/04/6-little-known-thing-that-can-cause-big-performance-issues/">6 Little Known Things That Can Cause Big Performance Issues</a> is a post from: <a href="http://thomaslarock.com">SQLRockstar | Thomas LaRock</a>
<p></p>
</p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a href="http://thomaslarock.com/2012/04/6-little-known-thing-that-can-cause-big-performance-issues/db_down/" rel="attachment wp-att-8570"><img class="alignleft  wp-image-8570" title="Ever have that sinking feeling?" src="http://thomaslarock.com/wp-content/uploads/2012/04/db_down.jpg?9d7bd4" alt="Ever have that sinking feeling?" width="314" height="244" /></a>As a system admin, DBA, or a developer it is our job to root out performance problems quickly. The trouble is that there are so many things that can cause performance issues it can be difficult to know every possible root cause. This is especially true when the root cause lies somewhere outside your area of expertise or control.</p>
<p>It is also true when the root cause is right under our noses the whole time.</p>
<p>Here are six things that I have seen cause performance issues for end users. None of them are complex by nature. Each is something that is simple and easily addressed when they are known.</p>
<p>So that&#8217;s why I wrote this post, in an effort to get these into the mainstream. If you are not taking steps to to mitigate these possible performance issues, start now. If you find yourself one day sitting at your screen and scratching your head wondering &#8220;what&#8217;s wrong&#8221;, then take a chance that one of these six things could be the culprit.</p>
<h3>1. Configure your memory settings</h3>
<p>I see this scenario all the time: Customer notices they are low on memory. They call me. I ask if they have configure the max memory setting to a non-default value. They say no.</p>
<p>Lather, rinse, repeat. I used to count the number of times this would happen to me but I stopped after the first hundred or so. It is one of the reasons I put together a talk on SQL Server memory management last year, because it just seemed to be the easiest thing for people to be doing <em>and yet they weren&#8217;t doing it</em>.</p>
<p>I <a href="http://thomaslarock.com/2011/03/misremembering-memory-settings/" target="_blank">wrote a post a while back</a> to help explain this fact as well. And then <a href="http://sqlserverperformance.wordpress.com/2009/10/29/suggested-max-memory-settings-for-sql-server-20052008/" target="_blank">there is this post</a> by Glenn Berry (<a href="http://glennberrysqlperformance.spaces.live.com/default.aspx">blog</a> | <a href="http://twitter.com/GlennAlanBerry" target="_blank">@GlennAlanBerry</a>) and <a href="http://sqlskills.com/blogs/jonathan/post/How-much-memory-does-my-SQL-Server-actually-need.aspx" target="_blank">one done by</a> Jonathan Kehayias (<a href="http://sqlskills.com/blogs/jonathan/" target="_blank">blog</a> | <a href="http://twitter.com/SQLPoolboy">@SQLPoolboy</a>), and yet still people don&#8217;t know to configure these settings. Take the few minutes you need to adjust your settings and you will reduce the chances of having performance problems due to memory settings.</p>
<h3>2. Optimize tempdb</h3>
<p>This one is often overlooked as most folks wait around for a problem with tempdb before thinking about how best to optimize it for performance right from the start. This <a href="http://sqlcat.com/sqlcat/b/top10lists/archive/2007/11/21/storage-top-10-best-practices.aspx" target="_blank">SQLCAT link</a> mentions this as well, and there is <a href="http://msdn.microsoft.com/en-us/library/ms175527.aspx" target="_blank">info over at MSDN that you should review</a> before making changes. And yes, you <em>should</em> consider moving tempdb to it’s own dedicated set of drives.</p>
<p>In fact, I would tell you that the placing of data files, log files, backup files, and tempdb onto separate disks <strong>should</strong> be a part of any standard database server build. I emphasize the ‘should’ because for some odd reason I still see shops where this is not true. If that is the case for you, and you need to boost performance, then roll up your sleeves and get started on the work that should have been done from the onset.</p>
<h3>3. Increase transaction log throughput</h3>
<p>Another area that will affect your database performance has to do with the configuration of your transaction logs. Kimberly Tripp (<a href="http://www.sqlskills.com/blogs/kimberly/">blog</a> | <a href="http://twitter.com/KimberlyLTripp">@KimberlyLTripp</a>) has a great post on the <a href="http://sqlskills.com/blogs/kimberly/post/8-steps-to-better-transaction-log-throughput.aspx" target="_blank">8 Steps to Better Transaction Log Throughput</a>. Many folks don&#8217;t think about how something as simple as managing log file growth properly can help with overall performance.</p>
<p>One of the hidden parts of transaction logs has to do with virtual log files (VLFs), the &#8220;chunks&#8221; that are strung together to form the transaction log. I wrote about VLFs a while back when I witnessed firsthand the havoc they could cause. Until I knew about VLFs I had no idea <a href="http://sqlskills.com/BLOGS/KIMBERLY/post/Transaction-Log-VLFs-too-many-or-too-few.aspx" target="_blank">why my log files were &#8220;misbehaving&#8221;</a>. After I found out about them I decided to come up with a way to identify databases that had too many VLFs and were causing us issues (both for performance and administrative activities) and took the necessary corrective actions. Those actions also led to a review of overall transaction log throughput, as I wanted to make certain we were deploying servers to our end users that were configured for performance right from the start because it is a real pain to go back after the fact and say things like &#8220;Oh, sorry, I didn&#8217;t realize you wanted that server to perform well, so we just gave you all the default stuff which is usually crappy, we can go back and fix all of that for you and have things ready in about two months.&#8221;</p>
<p>Save yourself that headache. Take care of your transaction logs from the start. You can thank me later.</p>
<h3>4. Build a proper reporting database</h3>
<p>I see a lot of &#8220;mixed-use&#8221; databases in every type of industry. At some point someone gets the idea that they need a database in order to store information, usually customer information at first, then things like products, inventory, or sales. You know, standard business stuff. Most of those systems are built along guidelines for typical transactional based processing. After some time, perhaps months or years, other people in the office think to themselves &#8220;hey, I need some info, and don&#8217;t we have it already in that database&#8221;? So they go about building some reports.</p>
<p>And before you can say &#8220;writers block readers&#8221; you soon have yourself an OLTP system that is being used more often for OLAP purposes. I used to have a job that would alert me whenever a spid was blocked for 300 seconds. That&#8217;s five minutes. Of doing nothing but waiting for someone else. When I would call the person and tell them something like &#8220;hey, you stuff is blocked and just sitting there, and it is Joe doing the blocking&#8221; I would get responses that would range from &#8220;OK, his stuff needs to run, so I can wait&#8221; to &#8220;OMG WTF IS JOE DOING IN MY DATABASE RIGHT NOW WHILE I AM TRYING TO FINISH MY WORK!&#8221;</p>
<p>Building a proper reporting solution can help you improve performance for everyone, and it is often never talked about. Usually people focus on trying to coexist when they should really talk about signing the divorce papers.</p>
<h3>5. Choosing the correct datatypes</h3>
<p>More often than not, database performance (good and bad) can be traced all the way back to the design phase. During that phase there is (or, there <em>should</em>) be a discussion around the choice of proper data types for the underlying data. Unfortunately I see that such discussions typically don&#8217;t happen, thanks to tools like Visual Studio that will create tables with columns that are nvarchar(50) by default.</p>
<p>Most of the time I try to talk to customer about the selection of data types and the impact on performance I get back one of two responses: &#8220;I didn&#8217;t know that&#8221; or &#8220;It&#8217;s vendor code, we can&#8217;t touch it&#8221;.  Clearly we need to raise awareness in either case. Also, we need to stop blaming the database for the problems that have been created at design time. The database is only doing what you have asked, and you have likely asked it to work inefficiently and slowly. Check out <a href="http://www.databasejournal.com/features/mssql/article.php/3718066/Disk-Space-Usage-and-SQL-Server-Performance.htm" target="_blank">this article by Greg Larsen</a> regarding performance and data types. And here is a list of <a href="http://sqlblog.com/blogs/aaron_bertrand/archive/2009/10/12/bad-habits-to-kick-using-the-wrong-data-type.aspx" target="_blank">bad habits to kick</a> by Aaron Bertrand (<a href="http://sqlblog.com/blogs/aaron_bertrand/">blog</a> | <a href="http://twitter.com/aaronbertrand" target="_blank">@aaronbertrand</a>).</p>
<h3>6. Configure Your Power Settings</h3>
<p>I know that &#8220;being green&#8221; is all in vogue these days. As a result we have things like <a href="http://blogs.msdn.com/b/cindygross/archive/2011/03/09/power-saving-options-on-sql-server.aspx" target="_blank">power savings options</a> for servers that allow for the CPU to be throttled when not in use. The net result of this is that you get the chance to explain to your end users that while <a href="http://sqlserverperformance.wordpress.com/2011/01/18/another-example-of-cpu-throttling-due-to-balanced-power-plan-in-windows-server-2008-r2/" target="_blank">database performance is not very good</a> they can feel better knowing that they are helping to keep polar bears colder at night. Then again, you can only make such a comment to them if you are aware about these power savings options. Since most people have no idea about these power settings they are likely to spend many fruitless hours trying to track down the root cause of performance issues. In an incredible twist of irony, the extra power they consume while trying to research the issue brought about by <em>power saving</em> results in those polar bears needing more and more suntan lotion with each passing year.</p>
<p>The above six items are all ways that you could be suffering from poor database performance. The problem I see with many DBAs is that they try to fix the <em>one thing</em> that is on their plate at the moment, without seeing a bigger picture. Similar to saying &#8220;you can&#8217;t see the forest through the trees&#8221;, many DBAs are so focused on getting one query at a time tuned that they never bother to look up and see things like memory settings, or transaction log configurations, or optimizing tempdb for performance as ways to improve performance. Rarely will I ever see a discussion about changing data types or building a proper report solution and yet those are also ways your performance could be slowly draining away.</p>
<p>These are all items that can be addressed early on in any project, or even a rollout of a new instance of SQL Server. It doesn&#8217;t take much time and the benefits are worth every minute.</p>
<p><p></p>
<a href="http://thomaslarock.com/2012/04/6-little-known-thing-that-can-cause-big-performance-issues/">6 Little Known Things That Can Cause Big Performance Issues</a> is a post from: <a href="http://thomaslarock.com">SQLRockstar | Thomas LaRock</a>
<p></p>
</p>
<div class="shr-publisher-8533"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://thomaslarock.com/2012/04/6-little-known-thing-that-can-cause-big-performance-issues/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Real World SQL Join Examples</title>
		<link>http://thomaslarock.com/2012/04/real-world-sql-join-examples/</link>
		<comments>http://thomaslarock.com/2012/04/real-world-sql-join-examples/#comments</comments>
		<pubDate>Thu, 19 Apr 2012 18:54:12 +0000</pubDate>
		<dc:creator>sqlrockstar</dc:creator>
				<category><![CDATA[Database Design]]></category>
		<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[SQL MVP]]></category>
		<category><![CDATA[SQLServerPedia Wiki]]></category>
		<category><![CDATA[big data]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[Diagram]]></category>
		<category><![CDATA[join]]></category>
		<category><![CDATA[PowerPivot]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://thomaslarock.com/?p=8480</guid>
		<description><![CDATA[I found a diagram recently that helped to explain the different types of JOIN syntax. Being the type person that enjoys the visualization of abstract concepts such as set theory this diagram spoke to me. Despite the diagram being well done something seemed slightly wrong about it. I thought about it for a while and then it [...]<p><p></p>
<a href="http://thomaslarock.com/2012/04/real-world-sql-join-examples/">Real World SQL Join Examples</a> is a post from: <a href="http://thomaslarock.com">SQLRockstar | Thomas LaRock</a>
<p></p>
</p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>I found a diagram recently that <a href="http://www.codeproject.com/Articles/33052/Visual-Representation-of-SQL-Joins" target="_blank">helped to explain the different types of JOIN syntax</a>. Being the type person that enjoys the visualization of abstract concepts such as set theory this diagram spoke to me. Despite the diagram being well done something seemed slightly wrong about it. I thought about it for a while and then it hit me: the diagram does not accurately reflect the complexity of joins for queries I see every day. The diagram seems better suited for a classroom, not the real world. So I decided to put together my own diagrams for you to show you the things I see frequently. You&#8217;re welcome.</p>
<h3>1. The Three Table Join</h3>
<p>This first diagram that I thought about was a simple three table join. In fact, I was going to put together a new diagram for all the possible three table joins but decided that I really did not have the desire to put together 127 different diagrams (I am leaving it as an exercise for the reader to explain why I could need 127 different diagrams, leave your answer in the comments below). So, here is the first type of join I thought about:</p>
<p><a href="http://thomaslarock.com/2012/04/real-world-sql-join-examples/joins-3/" rel="attachment wp-att-8490"><img class="alignleft size-full wp-image-8490" title="joins-3" src="http://thomaslarock.com/wp-content/uploads/2012/04/joins-3.png?9d7bd4" alt="" width="737" height="635" /></a></p>
<p>What I find worth mentioning here is that you can change your result set by altering that second join. Instead of A.c1 = C.c1, change it to B.c1 = C.c1 and you will find that you may not return the expected data in your select list (another exercise for the reader there, go ahead and try that for yourself <a href="http://thomaslarock.com/wp-content/uploads/2012/04/join.txt" target="blank">or you can just download this quick sample script</a>).</p>
<p>Another fascinating point here is that it occurred to me that this same T-SQL would also apply to the following:<a href="http://thomaslarock.com/2012/04/real-world-sql-join-examples/joins-3-gap/" rel="attachment wp-att-8488"><img class="alignleft size-full wp-image-8488" title="joins-3-gap" src="http://thomaslarock.com/wp-content/uploads/2012/04/joins-3-gap.png?9d7bd4" alt="" width="737" height="635" /></a></p>
<p>This diagram seems slightly more realistic to me, as I am likely to start with one table and need to go out to two (or more) other tables with joins.</p>
<h3>2. The Table Join For Disjointed Tables</h3>
<p>That idea got me thinking even more (always a dangerous thing) and I then thought about other types of joins I see frequently:<a href="http://thomaslarock.com/2012/04/real-world-sql-join-examples/joins-4/" rel="attachment wp-att-8489"><img class="alignleft size-full wp-image-8489" title="joins-4" src="http://thomaslarock.com/wp-content/uploads/2012/04/joins-4.png?9d7bd4" alt="" width="737" height="635" /></a></p>
<p>Yeah, that&#8217;s right&#8230;multiple tables with no relation between them. The end user just selects everything possible and then filters the rows based upon the WHERE clause or uses features in Excel or PowerPivot to do the filtering. In a way this is what I visualize &#8220;Big Data&#8221; to be, the grabbing of as much data as possible, mashing it together, and filtering the results until you find something that helps you get one step closer to wherever it is you wanted to go today.</p>
<h3>3. The One Big Table Join</h3>
<p>After that graph it suddenly occurred to me that there are a lot of people who create OLTP databases with really wide tables. I mean, REALLY wide tables, hundreds of columns. So, their syntax and graph looks like this: <a href="http://thomaslarock.com/2012/04/real-world-sql-join-examples/joins-1/" rel="attachment wp-att-8487"><img class="alignleft size-full wp-image-8487" title="joins-1" src="http://thomaslarock.com/wp-content/uploads/2012/04/joins-1.png?9d7bd4" alt="" width="737" height="635" /></a></p>
<p>Everything in one table, what a perfect database design, right? What could be simpler than that? In fact most data warehouses are built this way, where they have a few tables that are really wide and you may not need to join to any other tables. All the more reason to point out how the original diagram was not very indicative of the queries I see. In fact, the last picture I have for you is the EXACT type of query I see all the time.</p>
<h3>4. The &#8220;What Were They Thinking&#8221; Table Join</h3>
<p>How many times have you seen code similar to the following? Ever try to draw the picture? Here is my visualization: <a href="http://thomaslarock.com/2012/04/real-world-sql-join-examples/joins-14/" rel="attachment wp-att-8486"><img class="alignleft size-full wp-image-8486" title="joins-14" src="http://thomaslarock.com/wp-content/uploads/2012/04/joins-14.png?9d7bd4" alt="" width="941" height="640" /></a></p>
<p>Yes, that&#8217;s right, I <em>did</em> include the infamous =&#8217;NULL&#8217;, don&#8217;t pretend like you haven&#8217;t seen that one before! I also included column names of &#8216;pid&#8217; and &#8216;p_id&#8217; to give you an indication about how we often see column names that aren&#8217;t very descriptive and leave you wondering if the columns are truly representing the same value type.</p>
<p>I think the above five diagrams are a lot closer in reality to the types of queries we see every day. And the types of queries we are expected to tune, often immediately.</p>
<p>I often find it easier to help with performance problems once I am able to visualize what the joins are representing. I bet your end users would appreciate seeing similar diagrams as well, it may help them to understand what they are asking for, and it would likely help lead to a healthy discussion about design considerations. If nothing else, it should help to level set the expectations for performance.</p>
<p><p></p>
<a href="http://thomaslarock.com/2012/04/real-world-sql-join-examples/">Real World SQL Join Examples</a> is a post from: <a href="http://thomaslarock.com">SQLRockstar | Thomas LaRock</a>
<p></p>
</p>
<div class="shr-publisher-8480"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://thomaslarock.com/2012/04/real-world-sql-join-examples/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Expert Query Performance Troubleshooting</title>
		<link>http://thomaslarock.com/2012/04/expert-query-performance-troubleshooting/</link>
		<comments>http://thomaslarock.com/2012/04/expert-query-performance-troubleshooting/#comments</comments>
		<pubDate>Mon, 16 Apr 2012 17:05:48 +0000</pubDate>
		<dc:creator>sqlrockstar</dc:creator>
				<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[PASS]]></category>
		<category><![CDATA[Professional Development]]></category>
		<category><![CDATA[SQL MVP]]></category>
		<category><![CDATA[SQL Server Performance]]></category>
		<category><![CDATA[SQLServerPedia Wiki]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[optimizer]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[SQL Server 2012]]></category>

		<guid isPermaLink="false">http://thomaslarock.com/?p=8466</guid>
		<description><![CDATA[This video is an hour-long but well worth sharing with you today. One of the main takeaways from this video I want you to have is the fact that troubleshooting performance is not always rocket surgery. When you watch this video and listen to Conor Cunningham talk about some of the real world examples he [...]<p><p></p>
<a href="http://thomaslarock.com/2012/04/expert-query-performance-troubleshooting/">Expert Query Performance Troubleshooting</a> is a post from: <a href="http://thomaslarock.com">SQLRockstar | Thomas LaRock</a>
<p></p>
</p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>This video is an hour-long but well worth sharing with you today. One of the main takeaways from this video I want you to have is the fact that troubleshooting performance is not always rocket surgery. When you watch this video and listen to Conor Cunningham talk about some of the real world examples he has faced you will see what I mean.</p>
<p>I also liked how they help you to understand the concept of how to &#8220;bucketize&#8221; performance issues. It goes something like this:</p>
<p><em>Are <strong><span style="text-decoration: underline;">all</span></strong> queries affected, or just a <span style="text-decoration: underline;"><strong>subset</strong></span> of queries affected?</em></p>
<p>If all queries are having performance issues then you will want to examine settings that affect the entire instance, such as memory settings, or high CPU utilization. You will want to do this first before trying to examine any one particular query.</p>
<p>If it is only a subset of queries (or users, or a particular application) then you will want to focus your efforts on those queries first. Otherwise you will be wasting time trying to fix one query without addressing the root cause of the performance issue affecting all queries. [A great example of this for my customers has to do with virtualization: why waste time trying to tune one query when the reason for the slowness is because your memory settings have been dynamically changed? Better to spend five minutes talking to your server admins about the memory for your guest than to waste time trying to get a query to suddenly run faster with less memory available.]
<p>Just being able to diagnose &#8220;all versus some&#8221; in the first five minutes of triage in a production down situation can save you a lot of time as you begin to form your action plan to correct problem and bring performance back to within acceptable limits. Set aside some time this week to watch this video and learn more.</p>
<p><iframe title="YouTube video player" width="570" height="315" src="http://www.youtube.com/embed/Nbxg5crWq38" frameborder="0" allowfullscreen></iframe><div id="tentblogger-vimeo-youtube-message" style="width: 100%; border: 1px solid #e6e6e6; background: #f8f8f4; text-align:center; padding: 0.25em; ">Can't see the video in your RSS reader or email? <a target="_blank" href="http://thomaslarock.com/2012/04/expert-query-performance-troubleshooting/">Click Here!</a></div></p>
<p><p></p>
<a href="http://thomaslarock.com/2012/04/expert-query-performance-troubleshooting/">Expert Query Performance Troubleshooting</a> is a post from: <a href="http://thomaslarock.com">SQLRockstar | Thomas LaRock</a>
<p></p>
</p>
<div class="shr-publisher-8466"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://thomaslarock.com/2012/04/expert-query-performance-troubleshooting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The 6 Performance Tuning Mistakes You Don&#8217;t Want to Make</title>
		<link>http://thomaslarock.com/2012/04/the-6-performance-tuning-mistakes-you-dont-want-to-make/</link>
		<comments>http://thomaslarock.com/2012/04/the-6-performance-tuning-mistakes-you-dont-want-to-make/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 17:18:28 +0000</pubDate>
		<dc:creator>sqlrockstar</dc:creator>
				<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[SQL MVP]]></category>
		<category><![CDATA[SQL Server Performance]]></category>
		<category><![CDATA[SQLServerPedia Wiki]]></category>
		<category><![CDATA[Database Engine Tuning Advisor]]></category>
		<category><![CDATA[index]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[Profiler]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL 2012]]></category>
		<category><![CDATA[Statistics]]></category>

		<guid isPermaLink="false">http://thomaslarock.com/?p=8409</guid>
		<description><![CDATA[We&#8217;ve all had those moments.
It&#8217;s late in the day. You are about to head home a few minutes early so you can bring your daughter to soccer practice on time. Your phone rings. The voice on the other end of the line mutters something about the server &#8220;being slow&#8221;, and needs you to fix it [...]<p><p></p>
<a href="http://thomaslarock.com/2012/04/the-6-performance-tuning-mistakes-you-dont-want-to-make/">The 6 Performance Tuning Mistakes You Don&#8217;t Want to Make</a> is a post from: <a href="http://thomaslarock.com">SQLRockstar | Thomas LaRock</a>
<p></p>
</p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><div><a href="http://thomaslarock.com/2012/04/the-6-performance-tuning-mistakes-you-dont-want-to-make/clock/" rel="attachment wp-att-8433"><img class="alignleft size-medium wp-image-8433" title="clock" src="http://thomaslarock.com/wp-content/uploads/2012/04/clock-243x300.jpg?9d7bd4" alt="The pressure is on!" width="243" height="300" /></a>We&#8217;ve all had those moments.</div>
<p>It&#8217;s late in the day. You are about to head home a few minutes early so you can bring your daughter to soccer practice on time. Your phone rings. The voice on the other end of the line mutters something about the server &#8220;being slow&#8221;, and needs you to fix it so the company stops losing more and more money with each passing minute. You hang up the phone and see that the voice on the other end of the line has already sent an email to everyone in the company that blames the database server as the source of the problem and that they have spoken to you and you will have it fixed in the next five minutes.</p>
<p>You need to fix this, and fast. You company, and your family, is counting on you being there for them. You open up SQL Server Management Studio. You want to take action. Everyone is counting on you to get this done, and done right.</p>
<p>I am here to tell you about the six mistakes that many novice DBAs make when it comes to fixing performance issues. These mistakes may get you through the next few minutes but they are often band-aid solutions at best and sometimes <em>they can make performance even worse</em>.</p>
<h3><strong>1. Throwing Indexes at the Problem</strong></h3>
<p>Wait, don&#8217;t indexes help make performance better? So, wouldn&#8217;t <em>more</em> indexes mean <em>more performance</em>? No, not really. When it comes to indexes you can have too much of a good thing. And yet many novice DBAs look to add indexes whenever they come across a query that is not performing as well as expected. With tools such as the <a title="Database Engine Tuning Advisor - Not always evil, but not always good, either." href="http://msdn.microsoft.com/en-us/library/ms174202.aspx" target="_blank">Database Engine Tuning Advisor</a> at their fingertips they go about tuning individual statements and accepting all the default recommendations. And they end up fixing one issue and causing ten others.</p>
<p>Adding extra indexes is not always the right thing to do. Be wary of the easy path, <a title="Just say no" href="http://www.sqlskills.com/BLOGS/KIMBERLY/post/Indexes_JustBecauseUCan_NO.aspx" target="_blank">for it is often the wrong path</a>. What you want to do is research. Find out more about the entire workload hitting that table. Find out more about the database design and see if improvements can be made to existing structures before just adding new indexes. Remember this phrase: when it comes to adding indexes, just because you can doesn&#8217;t mean you should.</p>
<h3><strong>2. Using Index Hints Everywhere</strong></h3>
<p>After creating so many additional indexes some novice DBAs will then be confused as to why some indexes are not being used when expected. That is when they find out about <a title="SQL 2012 index hints" href="http://msdn.microsoft.com/en-us/library/ms187373.aspx" target="_blank">index hints</a> and so they go about forcing the optimizer to choose a specific index. Or maybe they will find out about <a title="SQL 2012 plan guides" href="http://msdn.microsoft.com/en-us/library/ms190417(v=sql.110).aspx" target="_blank">plan guides</a> and try those instead. This method works once and with great success and before too long it becomes the de facto standard to use index hints everywhere. In short, they go through a phase where they feel they are smarter than the optimizer. They will even proudly show you the plan guides they have that prove they are smarter than the optimizer. Apparently query algebra is a hobby for them, right?</p>
<p>If you think you are smarter than the optimizer I am here to tell you that you are not. Let the optimizer do the job it was designed to do and try to understand more about why it made the choice that it did. You think it should have used an index, or a different plan? Then you need to understand more about how and why <a title="13 things you should know about the optimizer" href="http://www.simple-talk.com/sql/t-sql-programming/13-things-you-should-know-about-statistics-and-the-query-optimizer/" target="_blank">the optimizer made the choice that it did</a>.</p>
<h3><strong>3. Updating Statistics Every Hour</strong></h3>
<p>We&#8217;ve all been there. A query suddenly takes longer to perform and the users are upset. In an effort to see if you can help get things running well again you update the statistics for the table and suddenly everything is better. A few hours later performance is bad again and you update the stats to make it go away. You sense a pattern and before you can say &#8220;<a href="http://www.bing.com/videos/watch/video/bad-idea-jeans/17w5aaq4o" target="_blank">Bad Idea jeans</a>&#8221; you have a job configured inside of SQL Agent to update the stats every hour in order to keep performance running smooth.</p>
<p>What could be wrong with such an approach? You have jumped ahead to a solution without understanding the root cause for the need to have frequent updates of statistics. Is the table poorly designed? Is the application deciding to do massive deletes and inserts because they once heard &#8220;updates are too costly&#8221;? You need to find the root cause before deciding upon a solution, and often that root cause is due to <a title="Bad sniff, BAD!" href="http://www.sqlsoldier.com/wp/sqlserver/misunderstoodandabusedupdatestatisticscommand" target="_blank">bad parameter sniffing</a>.</p>
<h3><strong>4. Running Profiler in Production</strong></h3>
<p>This is never a good idea and usually the sign of a last resort for a seasoned DBA. For the novice DBA, it is often a tool they use frequently, mostly because they haven&#8217;t seen the use of Profiler bring down a production server. Isn&#8217;t it ironic that in an effort to help improve database performance they end up using a tool that can cause performance to become worse, or even cause an outage?</p>
<p>How can it cause an outage? Did you know that <a title="whoops" href="http://msdn.microsoft.com/en-us/library/ms174203.aspx" target="_blank">Profiler uses the default temp space for the O/S</a>, which is often on the C: drive, which is where your O/S is stored. Ever see what happens when that drive gets filled? You can also store the results of your trace into a table and if you end up letting the trace run for so long you fill up a disk you will cause all other database activity to stop. Believe me, it happens, and when it does you don&#8217;t want to be sitting in a meeting the next day trying to explain that you were responsible for the production server being unusable yesterday. They hired you to keep things up and available, not to cause outages because you didn&#8217;t understand the effects of the tools you were using.</p>
<h3><strong>5. Flushing the Procedure Cache</strong></h3>
<p>When faced with symptoms of memory pressure and slow query performance many novice DBAs will look to find ways to reduce that pressure as quickly as possible in an effort to restore performance. For example, when faced with a low counter for the procedure cache hit ratio a novice may assume that many of the plans are now invalid and need to be flushed. So they reach for the DBCC FREEPROCCACHE statement in order to eject all plans from cache in an effort to restore performance. Again, they are jumping ahead to a solution without understanding the real problem.</p>
<p>Similar to the issue with updating statistics frequently, the idea of putting a job in place to flush your plan cache without <a title="Plan cache bloat - it's like a rash that keep coming back" href="http://www.sqlskills.com/BLOGS/KIMBERLY/post/Procedure-cache-and-optimizing-for-adhoc-workloads.aspx" target="_blank">understanding what is causing your plan cache to become bloated</a> in the first place is not the best idea. Take the time to find out why you are having issues with your plan cache before deciding that flushing it every hour is a viable solution. The end result may be you need to <a title="stored procedures - the egg mcmuffin of sql objects" href="http://www.sqlskills.com/BLOGS/KIMBERLY/post/Statement-execution-and-why-you-should-use-stored-procedures.aspx" target="_blank">change the method</a> in which calls are being made to your server.</p>
<h3><strong>6. Not Thinking About Tomorrow</strong></h3>
<p>Think of a ship, a plane, or a rocket. Each of them can only go so far, and so fast. Each has what is called <em>structural integrity</em>, and has performance thresholds that when crossed the structural integrity will fall apart. Guess what else has performance thresholds that when crossed will cause everything to fall apart? Your database.</p>
<p>You need to know what your thresholds are. How many simultaneous connections and inserts/updates/deletes can you sustain before performance starts to degrade? Just how fast can your ship travel before it breaks apart? If you don&#8217;t know this number then you don&#8217;t know when the wall is approaching and you could find yourself running right into it at full steam and knock yourself out.</p>
<p>Think of it this way: you are given a problem to solve, say a query is running slow. You make adjustments and it runs faster. But you never bother to check to see how well it can scale. A month later, the user workload has doubled, and the query is slow again. You dive back in and make some adjustments. Now people are wondering &#8220;why can&#8217;t they just make things work correctly&#8221;? A month later things are bad again and you need to make adjustments but you have no adjustments left to make. You have hit your threshold. There is nowhere else to go. But your end users need more.</p>
<p>Wouldn&#8217;t it have been good for you to have seen this coming sooner? Of course it would. Proper testing and bench marking is a forgotten art these days. Pick up a brush and learn to paint, it will pay off for you.</p>
<p><p></p>
<a href="http://thomaslarock.com/2012/04/the-6-performance-tuning-mistakes-you-dont-want-to-make/">The 6 Performance Tuning Mistakes You Don&#8217;t Want to Make</a> is a post from: <a href="http://thomaslarock.com">SQLRockstar | Thomas LaRock</a>
<p></p>
</p>
<div class="shr-publisher-8409"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://thomaslarock.com/2012/04/the-6-performance-tuning-mistakes-you-dont-want-to-make/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Love Your PowerPivot Mashups</title>
		<link>http://thomaslarock.com/2012/03/love-your-powerpivot-mashups/</link>
		<comments>http://thomaslarock.com/2012/03/love-your-powerpivot-mashups/#comments</comments>
		<pubDate>Wed, 14 Mar 2012 17:37:42 +0000</pubDate>
		<dc:creator>sqlrockstar</dc:creator>
				<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[SQLServerPedia Wiki]]></category>
		<category><![CDATA[Business Analytics]]></category>
		<category><![CDATA[Data]]></category>
		<category><![CDATA[Microsoft SQL Server]]></category>
		<category><![CDATA[PowerPivot]]></category>

		<guid isPermaLink="false">http://thomaslarock.com/?p=7991</guid>
		<description><![CDATA[This past Monday I listed out the five trends that data professionals need to be aware of and how it will impact their careers. I&#8217;m here to tell you something else: Dont just love your data, that isn&#8217;t enough. You need to make love to your data using tools like PowerPivot. Yesterday Rob Collie (blog &#124; @powerpivotpro) provided a [...]<p><p></p>
<a href="http://thomaslarock.com/2012/03/love-your-powerpivot-mashups/">Love Your PowerPivot Mashups</a> is a post from: <a href="http://thomaslarock.com">SQLRockstar | Thomas LaRock</a>
<p></p>
</p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>This past Monday I listed out the <a title="5 Critical Trends For The Data Professional of the Future" href="http://thomaslarock.com/2012/03/5-critical-trends-for-the-data-professional-of-the-future/" target="_blank">five trends that data professionals need to be aware</a> of and how it will impact their careers. I&#8217;m here to tell you something else: Dont just <a href="http://blog.infoadvisors.com/index.php/category/blog/" target="_blank">love your data</a>, that isn&#8217;t enough. You need to <strong><em>make love to your data</em></strong> using tools like PowerPivot. Yesterday Rob Collie (<a href="http://powerpivotpro.com/" target="_blank">blog</a> | <a href="http://twitter.com/powerpivotpro" target="_blank">@powerpivotpro</a>) provided a <a href="http://www.powerpivotpro.com/2012/03/moores-law-and-inflation/" target="_blank">shining example</a>.</p>
<p>A few weeks ago I <a href="http://www.popsci.com/node/58214/" target="_blank">came across this article</a> and I had an idea: could I find out how many computations per second I would get for $1? And could I show how, over time, we are getting more for our money? And could I adjust for inflation? And if I did chart it all out, what would the data tell me, besides the fact that apparently the PS3 is faster per dollar than any other machine on Earth right now?</p>
<p>I had lots of questions. I had lots of tools at my disposal. What I didn&#8217;t have was time. I wanted an answer, quickly, but no time to get it done. So I turned to someone I knew could help get it done. Rob is one of the leading experts in <a href="http://searchbusinessanalytics.techtarget.com/definition/business-analytics-BA" target="_blank">Business Analytics</a>. If you haven&#8217;t <a href="http://thomaslarock.com/2012/02/the-santa-cruz-experiment-why-you-should-care-about-big-data/" target="_blank">heard that term before</a>, get used to it. Because it&#8217;s our future.</p>
<p><a href="http://thomaslarock.com/2012/03/love-your-powerpivot-mashups/image28/" rel="attachment wp-att-7994"><img class="alignleft size-full wp-image-7994" title="image28" src="http://thomaslarock.com/wp-content/uploads/2012/03/image28.png?9d7bd4" alt="" width="641" height="394" /></a>Rob took my idea and ran with it. He subscribed to <a href="http://www.shadowstats.com/" target="_blank">ShadowStats.com</a> in order to get more data to use to correlate my thoughts. He then started applying his own thoughts regarding Moore&#8217;s Law. His graphs help to show that Moore&#8217;s Law is becoming stagnant, and that in 18 months we shouldn&#8217;t expect things to be twice as fast anymore. In other words, he took my idea and was able to quickly gather data, perform analysis, postulate his own theory, and return the entire results back in a very short amount of time.</p>
<p>This is the future for data professionals. It isn&#8217;t about racking servers. It&#8217;s about getting people access to the data they want, in a meaningful way, and quickly. As a DBA you are already very familiar with data. How it moves, how it&#8217;s stored, how it should look. Take those skills and start learning how to apply them in a different manner.</p>
<p>Soon you will find your skills in demand in a similar manner to Rob. The guy is flat out busy for a reason.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/pixy.gif?x-id=75a1b05a-348c-420e-b1ac-b61b6f54aba6" alt="" /></div>
<p><p></p>
<a href="http://thomaslarock.com/2012/03/love-your-powerpivot-mashups/">Love Your PowerPivot Mashups</a> is a post from: <a href="http://thomaslarock.com">SQLRockstar | Thomas LaRock</a>
<p></p>
</p>
<div class="shr-publisher-7991"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://thomaslarock.com/2012/03/love-your-powerpivot-mashups/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Why Is My Server Running Slow?</title>
		<link>http://thomaslarock.com/2012/03/why-is-my-server-running-slow/</link>
		<comments>http://thomaslarock.com/2012/03/why-is-my-server-running-slow/#comments</comments>
		<pubDate>Tue, 13 Mar 2012 17:38:29 +0000</pubDate>
		<dc:creator>sqlrockstar</dc:creator>
				<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[SQL MVP]]></category>
		<category><![CDATA[SQLServerPedia Wiki]]></category>
		<category><![CDATA[Travel]]></category>
		<category><![CDATA[Choose Your Own Adventure]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[Microsoft SQL Server]]></category>
		<category><![CDATA[performance tuning]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://thomaslarock.com/?p=7969</guid>
		<description><![CDATA[It&#8217;s Sunday evening. You are sitting down to have dinner with your family. Suddenly your phone rings. You want to ignore it because, let&#8217;s face it, your phone rings a lot. But you see the person calling and knowing they don&#8217;t call very often you decide to answer. On the other end of the line [...]<p><p></p>
<a href="http://thomaslarock.com/2012/03/why-is-my-server-running-slow/">Why Is My Server Running Slow?</a> is a post from: <a href="http://thomaslarock.com">SQLRockstar | Thomas LaRock</a>
<p></p>
</p>
]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>It&#8217;s Sunday evening. You are sitting down to have dinner with your family. Suddenly your phone rings. You want to ignore it because, let&#8217;s face it, your phone rings a lot. But you see the person calling and knowing they don&#8217;t call very often you decide to answer. On the other end of the line a harried voice tells you the words that every DBA dreads hearing:</p>
<p>&#8220;The server is slow.&#8221;</p>
<p>Many thoughts run through your head: <em>Well of course it is, otherwise you wouldn&#8217;t be calling, right? And why doesn&#8217;t anyone ever call me to tell me that the server is running fast? And what, exactly, is meant by &#8220;slow&#8221;? </em></p>
<p>&#8220;OK, do you have any other details for me?&#8221; you ask.</p>
<p>&#8220;Yeah, I sent you an email an hour ago with some charts that PAL returned. Don&#8217;t you check your email all day on Sundays?&#8221;</p>
<p>You resist the urge to hang up and go to your laptop to examine the images that were sent. You see the following:</p>
<div id="attachment_7974" class="wp-caption alignleft" style="width: 623px"><a href="http://thomaslarock.com/2012/03/why-is-my-server-running-slow/pal_ple/" rel="attachment wp-att-7974"><img class="size-full wp-image-7974" title="pal_ple" src="http://thomaslarock.com/wp-content/uploads/2012/03/pal_ple.png?9d7bd4" alt="" width="613" height="480" /></a><p class="wp-caption-text">Page Life Expectancy</p></div>
<div id="attachment_7973" class="wp-caption alignleft" style="width: 623px"><a href="http://thomaslarock.com/2012/03/why-is-my-server-running-slow/pal_lzy/" rel="attachment wp-att-7973"><img class=" wp-image-7973 " title="pal_lzy" src="http://thomaslarock.com/wp-content/uploads/2012/03/pal_lzy.png?9d7bd4" alt="" width="613" height="474" /></a><p class="wp-caption-text">Lazy Writes per Second</p></div>
<div id="attachment_7972" class="wp-caption alignleft" style="width: 623px"><a href="http://thomaslarock.com/2012/03/why-is-my-server-running-slow/pal_prs/" rel="attachment wp-att-7972"><img class=" wp-image-7972 " title="pal_prs" src="http://thomaslarock.com/wp-content/uploads/2012/03/pal_prs.png?9d7bd4" alt="" width="613" height="470" /></a><p class="wp-caption-text">Page Reads per Second</p></div>
<div id="attachment_7971" class="wp-caption alignleft" style="width: 623px"><a href="http://thomaslarock.com/2012/03/why-is-my-server-running-slow/pal_fss/" rel="attachment wp-att-7971"><img class=" wp-image-7971 " title="pal_fss" src="http://thomaslarock.com/wp-content/uploads/2012/03/pal_fss.png?9d7bd4" alt="" width="613" height="470" /></a><p class="wp-caption-text">Full Scans per Second</p></div>
<div id="attachment_7970" class="wp-caption alignleft" style="width: 623px"><a href="http://thomaslarock.com/2012/03/why-is-my-server-running-slow/pal_brs/" rel="attachment wp-att-7970"><img class=" wp-image-7970 " title="pal_brs" src="http://thomaslarock.com/wp-content/uploads/2012/03/pal_brs.png?9d7bd4" alt="" width="613" height="472" /></a><p class="wp-caption-text">Batch Requests per Second</p></div>
<p>So, why is the server running slow?</p>
<p>Next week Jason Strate (<a href="http://www.jasonstrate.com/">blog</a> | <a href="http://twitter.com/stratesql" target="_blank">@stratesql</a>) and I will be doing a presentation for the <a href="http://minnesota.sqlpass.org/" target="_blank">Minnesota SQL Server User Group (PASSMN)</a>. The title of the talk is &#8220;Choose Your Own Adventure: Performance Tuning&#8221;. We will walk you through a scenario not unlike the one I have outlined above. We will talk about the various techniques you have at your disposal when it comes to performance tuning and help you understand which techniques are most useful.</p>
<p>And you, the audience, will decide how we troubleshoot and solve the scenario presented. Life is an adventure, and at times so is performance monitoring and troubleshooting.</p>
<p>Think about what you would do first for the scenario above, or what a new DBA might do, or what an MCM might do. Think about how long you have before your manager decides to hire a DBA that has all the answers already. Think about what you can do to fix this issue immediately. What steps would you take? What questions would you ask? Leave your comments below.</p>
<p><p></p>
<a href="http://thomaslarock.com/2012/03/why-is-my-server-running-slow/">Why Is My Server Running Slow?</a> is a post from: <a href="http://thomaslarock.com">SQLRockstar | Thomas LaRock</a>
<p></p>
</p>
<div class="shr-publisher-7969"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://thomaslarock.com/2012/03/why-is-my-server-running-slow/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: basic
Database Caching 7/82 queries in 0.091 seconds using disk: basic
Object Caching 2093/2254 objects using disk: basic

Served from: thomaslarock.com @ 2012-05-23 10:10:17 -->
