Using MAX_GRANT_PERCENT

The MIN_GRANT_PERCENT and MAX_GRANT_PERCENT hints were first introduced in SQL Server 2012 SP3 and are now in SQL Server 2016 RTM (they are still not available in SQL Server 2014). They address the problem of inappropriate memory grant for query execution.

Memory grant is a memory associated with the execution of queries whose execution plan contains operators that need to store temporary row data while sorting and joining rows (Sort, Hash Join, and others). The value for memory grant depends on SQL Server's Estimated Number of Rows that should be processed by memory operators. If the Estimated Number of Rows significantly differs from the actual number, the memory grant is overestimated or underestimated.

To demonstrate ...

Get SQL Server 2017 Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.