Optimization hints and plan guides

Chapter 11 looks at many different execution plans and discusses what it means for a query to be optimized. This chapter looks at situations in which SQL Server reuses a plan when it might have been best to come up with a new one, and you’ve seen situations in which SQL Server doesn’t reuse a plan even if a perfectly good one is in cache already. One way to encourage plan reuse that has already been discussed in this chapter is to enable the PARAMETERIZATION FORCED database option. In other situations, where you just can’t get the optimizer to reuse a plan, you can use optimization hints. Optimization hints can also be used to force SQL Server to come up with a new fplan in those cases in which it might be using ...

Get Microsoft SQL Server 2012 Internals now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.