Editorials

SQL Server Query Optimization Tips

Featured Article(s)
Tips for using SQL Server 2005 Query Hints (Part 1)
Here are some helpful tips to optimize your SQL Server 2005 queries by using hints.

Query Optimization Tips
Yesterday I wrote about a quick approach to figuring out which of a few different ways is the best query to run. I ran across a great article from Pinal Dave too – it’s all about best practices for optimizing your queries – from keys to indexes and a lot more – take a look here.

My only real issues with the list of best practices is the same as many lists – that, taken separately, they’re all great. But, if you apply reality to the best practices, it’s almost like they need an asterisk for "exceptions" to the rule. That said, it’s important to take a look at the list and see how you can apply different techniques to the work you’re doing optimizing queries, applications and work with SQL Server in general.

What would you add to the list? Anything you’d argue with on the list as presented?

I know one that we continually run into is removing unneeded/unused joins. This, and unused indexes, is especially true of older systems. When your system/schema has been around awhile, you’ve no-doubt added indexes to address specific issues of performance or queries. Sometimes these queries can later be morphed into new reports, new queries, etc. These new approaches don’t necessarily use the same indexes and joins and… well, you get the idea.

Guess this is another case for reviewing systems from time-to-time. Remember, too, that with SQL Server 2008, you can start to automate some of this review. You can use the data collector and reporting systems to pull this information for you and let you know what items are no longer being used.

So, what would you add/change/delete from the best practices list? Drop me a note here.

Featured White Paper(s)
Selecting the Right Change Management Solution
Frequent application updates, data migrations, service level requirements, and new compliance mandates mean your company need… (read more)