Skip to Content
Microsoft® SQL Server 2012 Unleashed
book

Microsoft® SQL Server 2012 Unleashed

by Ray Rankins, Paul T. Bertucci, Chris Gallelli, Alex T. Silverstein
December 2013
Intermediate to advanced
1872 pages
153h 31m
English
Sams
Content preview from Microsoft® SQL Server 2012 Unleashed

Using the USE PLAN Query Hint

The USE PLAN query hint in SQL Server 2012 can be used to encourage the Query Optimizer to use the specified XML query plan for processing the query. This option provides more control over influencing the execution of a query than is possible with the other available query hints, such as FORCE ORDER, LOOP JOIN, and KEEP PLAN. None of these options individually are powerful enough to influence the Query Optimizer to consistently choose a particular query plan, especially when the referenced table row counts, statistics, indexes, and other attributes of the environment change.

The USE PLAN query hint is specified in the OPTION clause, and you provide it with a query plan in XML format. Listing 31.7 provides an example ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microsoft® SQL Server 2008 R2 Unleashed

Microsoft® SQL Server 2008 R2 Unleashed

Ray Rankins, Paul Bertucci, Chris Gallelli, Alex T. Silverstein
Inside Microsoft® SQL Server® 2008: T-SQL Programming

Inside Microsoft® SQL Server® 2008: T-SQL Programming

Dejan Sarka Itzik Ben-Gan Greg Low, Roger Wolter, Ed Katibah, and Isaac Kunen

Publisher Resources

ISBN: 9780133408539Purchase book