O'Reilly logo

SQL Server Execution Plans, 2nd Edition by Grant Fritchey

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5: Controlling Execution Plans with Hints

It is possible, using various available hints, to impose your will on the optimizer and, to some degree, control its behavior. There are three categories of hints, which include:

  • Query hints tell the optimizer to apply a hint throughout the execution of the entire query.
  • Join hints tell the optimizer to use a particular join at a particular point in the query.
  • Table hints control Table Scans and the use of a particular index for a table.

In this chapter, I'll describe how to use each type of hint, but I can't stress the following enough: hints are dangerous. Hints detract from the optimizer's ability to make choices. Appropriate use of the right hint on the right query can improve query performance. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required