Quantcast
Channel: SQL Server
Viewing all articles
Browse latest Browse all 3819

Blog Post: Tuesday Tips: SQL Server Optimization - “Cache"ing Best Practices

$
0
0
When’s the last time you opened your junk drawer? No, not the bottom drawer of your work filing cabinet that’s jam-packed with five years-worth of paystubs, outdated lunch takeout menus, a stack of address labels and a bunch of other nonsense that you likely don’t need and won’t look at any time soon. I’m talking about your SQL Server junk drawer – the plan cache. It’s the home to SQL Server execution plans. While many execution plans within the cache are used frequently, others may be used only once or very infrequently. A surefire way to improve performance? Clean it out. Among other tips and best practices for SQL Server optimization, SQL Server pros Patrick O’Keefe and Richard Douglas recommend the following two related to the plan cache: 1)      Get to the cause of the problem in the plan cache – If you have SQL Server monitoring processes in place, analyzing performance counters will likely spot a bottleneck -- a rogue query in the plan cache. What’s next? Well, if you’re using SQL Server 2005 or newer, identifying the problem workload is relatively straight forward. Simply use Dynamic Management Objects to run a query. If the bottleneck is related to CPU, run a query to identify the top CPU consumer on the server. Same deal for diagnosing an I/O bottleneck. 2)      Improve caching by query plan reuse – In order to execute, all SQL Statements need a query plan that defines the query method, instruction and action. Each new plan = more CPU = inefficiency and poor performance. Getting into the habit of reuse will deliver efficiency improvements, but it’s often difficult to determine which workload is the offending query plan as it’s usually associated with a client application. Use the Extended Events or Profiler commands sniff it out. Read the Dell Software whitepaper: “ Top 10 Tips for Optimizing SQL Server Performance .” A bit of housekeeping in the plan cache could go a long way. Not to mention that the plan cache provides a ton of information that can give insight into the overall health of your SQL Server. Instead of stuffing more junk in there, take a peek. You might just find a $20 folded inside one of those menus… For more tips on SQL Server optimization, download the Dell Software whitepaper here for free.

Viewing all articles
Browse latest Browse all 3819

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>