Batch mode adaptive memory grant feedback

When SQL Server compiles the execution plan for a query, it has to choose appropriate operators and eventually memory that is required for the query execution. This memory grant size is based on the Estimated Number of Rows for the operator and the associated average row size. If the cardinality estimates are significantly inaccurate, this can lead to poor performance. Underestimations can degrade the performance of the execution query since intermediate rows cannot fit in memory and must be spilled to the disk. On the other hand, overestimations lead to large memory grants and the wasting of memory, which can affect other queries and overall performance.

In one of the previous sections, you saw that ...

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

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