30.06.2013 Views

SQL Server Execution Plans - Red Gate Software

SQL Server Execution Plans - Red Gate Software

SQL Server Execution Plans - Red Gate Software

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 8: Advanced Topics<br />

In the previous chapters, we have discussed how the optimizer generates execution plans<br />

and how to interpret them, and we have examined plans for some moderately complex<br />

queries, including most of the common <strong>SQL</strong> <strong>Server</strong> objects, such as stored procedures,<br />

views, indexes, cursors, and so on. In our discussion of hints, we even walked through<br />

some ways in which we could exercise a measure of control over how the optimizer<br />

generates an execution plan.<br />

In this chapter, we will take a tour of some of the more advanced topics related to the<br />

interpretation and manipulation of execution plans, covering the points below.<br />

• Large-scale execution plans – How to interpret them.<br />

• Parallelism – Why you might want to use parallelism, how to control it in your query<br />

execution and how to interpret parallel plans.<br />

• Forced parameterization – Used to replace hard-coded literals with parameters<br />

and maximize the possibility of plan reuse; used mainly in systems subject to a large<br />

amount of ad hoc, or client-generated T-<strong>SQL</strong>.<br />

• Using plan guides – To exercise control over a query through hints without changing<br />

the actual code; an invaluable tool when dealing with third-party applications.<br />

• Using plan forcing – To capture and reuse an execution plan, the final word in<br />

controlling many of the decisions made by the optimizer.<br />

287

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

Saved successfully!

Ooh no, something went wrong!