Optimizing PerformanceNow that you know how the internals of SQL Server work and how database design affects performance, we are going to introduce you to some performance tuning topics of interest.Database Performance and I/O Configuration OptionsHere we will discuss some of the performance counters you might want to keep an eye on to ensure your SQL Server is working like it should. When SQL Server reads data from tables, it uses Windows system I/O calls to perform this. SQL Server decides when and how this access is performed, but the operating system actually performs the work. Disk I/O is the most frequent reason for performance bottlenecks, so you should not forget to monitor this activity on your server. As always, use System Monitor (or Performance MMC, as it is called in Windows XP/Windows Server 2003) to monitor your system. Figure 8-15 shows two performance counters:
If the values for these two counters are near the capacity of the hardware, you should try to reduce them by tuning your databases or applications. You can do this by reducing I/O operations: Check your indexes so they are accurate or try normalizing your databases even more. If this still does not help, try increasing the I/O capacity of your hardware or adding more memory.TIP If you find your bottleneck involves inserts and updates, you could try to normalize your data more. If you instead find that queries cause the bottleneck, you could try to denormalize the database. The problem with such a solution is that you might need to rewrite your applications to handle a new database structure. This might not be a problem if you discover this early in development, but in production this can be costly. Sometimes this might be the only way to correct the problem, however, and then you just have to deal with it.You could monitor how much memory SQL Server is using by checking the value for SQL Server: Memory Manager Total Server Memory (KB). Compare this to how much memory the operating system has available by checking the counter Available Kbytes from the Memory object. This could give a clue to deciding if there is a need to restrict how much memory SQL Server is allowed to use. Next, we will move on to clustering SQL Server.