Specifying Query Processing Hints

SQL Server 2014 enables you to specify additional query hints to control how your queries are optimized and processed. You specify query hints at the end of a query by using the OPTION keyword. There can be only one OPTION clause per query, but you can specify multiple hints in an OPTION clause, as shown in the following syntax:

OPTION (hint1 [, ...hintn])

Query hints are grouped into four categories: GROUP BY, UNION, JOIN, and miscellaneous.

GROUP BY Hints

GROUP BY hints specify how GROUP BY or COMPUTE operations should be performed. The following GROUP BY hints can be specified:

HASH GROUP—This option forces the Query Optimizer to use a hashing function to perform the GROUP ...

Get Microsoft SQL Server 2014 Unleashed now with O’Reilly online learning.

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