Archive for the ‘SQL Server Performance Tuning’ Category

Using Perfmon and Profiler

Tuesday, February 9th, 2010

At the SQLBits conference in Great Britain last fall, Brent Ozar gave a presentation called “Using Perfmon and Profiler.”  He covered:

  • Why Windows Task Manager is nothing more than a check-engine light
  • His performance tuning lifecycle
  • Why you need to capture baselines (and how to do it)
  • Several sample tuning scenarios

You can watch this 52-minute presentation free courtesy of SQLBits:

Get the Flash Player to see the wordTube Media Player.

If you liked this presentation, you can watch any of the SQLBits presentations at their web site, including:

Subscribing or Downloading the Podcast

If you have an MP3 player or a portable video player and you want to download our videos automatically, you can subscribe to our podcast feeds here:

You can also download this video to watch it later:

SQL Server Performance Tuning, Formula 1 Style

Tuesday, February 2nd, 2010

At the SQLBits conference in Great Britain last fall, Brent Ozar gave a presentation called “T-SQL Tuning with Colin Chapman, Enzo Ferrari, and The Stig.”  He covered:

  • Why Colin Chapman would check for indexes before adding new ones
  • The importance of well-tested safety gear to performance tuning
  • Why not monitoring your servers is like overdriving your headlights
  • Just like races are lost in the pits, uptime records are lost during maintenance windows

You can watch this 41-minute presentation free courtesy of SQLBits:

Get the Flash Player to see the wordTube Media Player.

If you liked this presentation, you can watch any of the SQLBits presentations at their web site, including:

Subscribing or Downloading the Podcast

If you have an MP3 player or a portable video player and you want to download our videos automatically, you can subscribe to our podcast feeds here:

You can also download this video to watch it later:

Kevin Kline Tutorial on SQL Server Query Tuning

Thursday, July 2nd, 2009

Kevin Kline gave an hour-long presentation to the Nashville PASS Chapter on Query Performance Tuning.  He covered tips like NOCOUNT, SHOWPLAN, STATISTICS, and low-hanging fruit to make queries faster.

Get the Flash Player to see the wordTube Media Player.

Subscribing or Downloading the Podcast

If you have an MP3 player or a portable video player and you want to download our videos automatically, you can subscribe to our podcast feeds here:

You can also download this video to watch it later:

Old Performance Tuning Recommendations Die Hard

Tuesday, June 23rd, 2009

It’s interesting to me that old and inaccurate performance tuning recommendations seem to have a life of their own.  In some ways, old performance tuning recommendations are like the Undead from some kind of cheesy, 1970’s zombie movie – no matter how many times you shoot them, they just keep coming back.

 

Here’s a good case in point, http://msdn2.microsoft.com/en-us/library/ms345118.aspx, a white paper discussing Performance Optimizations for the XML data type in SQL Server 2005.  The document states:

 

Multiple tempDB Files for Better Scalability of XML Variables and Parameters

XML variables and parameters use main memory as storage as long as their values are small. Large values, however, are backed by tempdb storage. In a multi-user scenario, if many large XML blobs occur, tempdb contention may become a bottleneck for good scalability. Creating multiple tempdb files reduces the storage contention and yields significantly better scalability. The next example illustrates how multiple tempdb files can be created.

Example: Creating Multiple tempdb Files

This example creates two additional data files for tempdb, each with an initial size of 8 MB, and two log files with an initial size of 1 MB.

Copy Code

USE TEMPDB
GO
ALTER DATABASE tempdb ADD FILE 
   (NAME = 'Tempdb_Data1', 
      FILENAME = 'C:\temp\Tempdb_Data1.MDF', SIZE = 8 MB),  
   (NAME = 'Tempdb_Data2', 
      FILENAME = 'C:\temp\Tempdb_Data2.MDF', SIZE = 8 MB) 
GO
ALTER DATABASE tempdb ADD log FILE 
   (NAME = 'Tempdb_Log1',
      FILENAME = 'C:\temp\Tempdb_Log1.LDF', SIZE = 1 MB),  
   (NAME = 'Tempdb_Log2',
      FILENAME = 'C:\temp\Tempdb_Log2.LDF', SIZE = 1 MB)
GO

These files can be removed by using the ALTER DATABASE tempdb REMOVE FILE command. For more information, see SQL Server Books Online.

 

 

There was a time when this recommendation made sense.  The intent behind multiple tempdb files prior to SQL Server 2005 was to avoid GAM contention on very high throughput scenarios.  Later, SQL Server 2005 introduced segmented GAMs even within a single tempdb file. 

 

This recommendation still holds for data files, especially on systems using NUMA processors, where IO should be aligned with one data file per NUMA socket.  (It also does no harm on an SMP system to organize your data files this way, hence the standardized recommendation.)

 

However, the recommendation fails when you get to the log portion of the equation.  Why?  It’s because data file IO is written using the proportional file algorithm where each data file has data written to it in round-robin style.  On the other hand, log files are written using the active file algorithm where LogFile1 is written first until full, then LogFile2 is written next until full, and so on…  Long story made short (too late, I know) – you get no performance gain from having multiple files in the log because all writes occur on only one file.  You can only get a performance gain from multiple files on the data portion of a database.

 

As an aside, Simon Sabin (http://sqlblogcasts.com/blogs/simons/) has a wonderful collection of addition myths, misunderstandings, and miscommunications.  I’m not sure if they’re put together in a single blog post, so put his blog on your watch list.

 

Cheers,

 

-Kev

 

P.S.  Thanks to Tony Rogerson (http://sqlblogcasts.com/blogs/tonyrogerson) and Geoff Hiten for the inspiration on this blog post, btw.

 

P.P.S.  I like how the MSDN article refers to SQL Server 2005 as SQL Server 9.0.  ;^)

SQLIO Tutorial

Monday, April 13th, 2009

SQLIO tests how fast your hard drives perform, but it’s not easy to use. Brent shows how to create a SQLIO batch file and analyze the results.

Get the Flash Player to see the wordTube Media Player.

For more about SQLIO, check out the SQLIO tutorial wiki article.  We’ve got sample scripts you can use, and instructions on how to get the result data into a database for easier analysis.

If you have an MP3 player or a portable video player and you want to download our videos automatically, you can subscribe to our podcast feeds here:

You can also download this video to watch it later:

Index Tuning Part 4: Outsmarting the Wizards

Thursday, April 2nd, 2009

SQL Server’s Dynamic Management Views (DMVs) can tell you what indexes need to be added – without doing any tracing or performance monitoring. In this video tutorial, we’ll show you how.

Get the Flash Player to see the wordTube Media Player.

In the podcast, we mention a few links:

If you have an MP3 player or a portable video player and you want to download our videos automatically, you can subscribe to our podcast feeds here:

You can also download this video to watch it later:

Index Tuning Part 3: Adding New Indexes

Monday, March 30th, 2009

SQL Server’s Dynamic Management Views (DMVs) can tell you what indexes need to be added – without doing any tracing or performance monitoring.  In this video tutorial, we’ll show you how.

Get the Flash Player to see the wordTube Media Player.

In the podcast, we mention a few links:

If you have an MP3 player or a portable video player and you want to download our videos automatically, you can subscribe to our podcast feeds here:

You can also download this video to watch it later:

Index Tuning Part 2: Included Fields

Thursday, March 26th, 2009

SQL Server 2005 introduced a new way to design wide indexes for improved performance and less page splits. Sounds complex, but it’s easy, and it can make a real difference in performance. In this video tutorial, we’ll show you what it’s all about.

Get the Flash Player to see the wordTube Media Player.

In the podcast, we mention a few links:

If you have an MP3 player or a portable video player and you want to download our videos automatically, you can subscribe to our podcast feeds here:

You can also download this video to watch it later:

Index Tuning Part 1: Removing Extra Indexes

Tuesday, March 24th, 2009

The first step in making your SQL Server faster is removing indexes that are making things worse instead of better.  In this podcast, we’ll show you how.

Get the Flash Player to see the wordTube Media Player.

In the podcast, we mention a few links:

If you have an MP3 player or a portable video player and you want to download our videos automatically, you can subscribe to our podcast feeds here:

You can also download this video to watch it later:

Examples of Using Perfmon and Profiler

Tuesday, February 24th, 2009

After learning how to use Perfmon and Profiler to capture statistics about your SQL Server, how do you go about troubleshooting to find out what the problem is?  In this eleven minute video, Brent walks through four example problems he had, what the numbers told him, and what he recommended to management to solve the issues.

 

The scripts and related links for this podcast are:

If you have an MP3 player or a portable video player and you want to download our videos automatically, you can subscribe to our podcast feeds here:

You can also download this video to watch it later: