30.06.2013 Views

Performance Tuning with SQL Server Dynamic Management Views

Performance Tuning with SQL Server Dynamic Management Views

Performance Tuning with SQL Server Dynamic Management Views

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 5: Indexing Strategy and Maintenance<br />

Also, be warned that the order in which these DMOs list missing columns does not accurately<br />

suggest the correct column order for an index key. Furthermore, in our experience,<br />

these DMOs are often over-enthusiastic in suggesting INCLUDE columns. They are best<br />

used to find the biggest "holes" in an indexing strategy, not as a fine-tuning tool.<br />

In addition, Microsoft Books Online lists the following specific limitations:<br />

• cannot gather statistics for more than 500 missing index groups<br />

• return less accurate cost information for queries involving only inequality predicates<br />

• reports only include columns for some queries, so index key columns must be<br />

manually selected<br />

• return only raw information about columns on which indexes might be missing<br />

• can return different costs for the same missing index group that appears multiple times<br />

in XML Showplans.<br />

Finding the most beneficial missing indexes<br />

So how do you go about putting these DMOs to good use? Our goal is clearly to obtain<br />

a list of missing indexes, <strong>with</strong> the most useful ones listed at the top. The <strong>SQL</strong> <strong>Server</strong><br />

Query Optimization Team at Microsoft proposed the following formula for calculating<br />

the overall benefit of a suggested index, based on the columns in the _group_stats<br />

DMV, and it has been widely adopted:<br />

(user_seeks + user_scans) * avg_total_user_cost * (avg_user_impact * 0.01)<br />

205

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!