Monday, September 28, 2009

MS SQL Server Profiling - Missing Indexes

If you are using MS SQL Server, there is a good chance that you have (or will have) to monitor and improve some of your queries.

Since its 2005 edition, SQL Server provides a feature to find the missing indexes, giving you some information about potential indexes that it thinks would improve performances. This information can be really useful to proactively improve the queries that are getting slower when the number of records grow.

However, like almost everything, this is not all back or white...you should consider the proposed information, but not create dozens of indexes on every table if you don't want your server to spend all its time, processing and especially I/O to maintain indexes.

On the same topic, you will find a couple of nice SQL statements below: