Skip to content

Commit ee6e703

Browse files
Merge pull request #28282 from WilliamDAssafMSFT/20230908-applies-to-sql-db
20230908 MGF applies
2 parents 944a86d + f3802c0 commit ee6e703

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

docs/relational-databases/performance/intelligent-query-processing-feedback.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ The feedback features discussed in this article are:
3535

3636
## Memory grant feedback
3737

38-
Sometimes a query executes with a memory grant that is too large or too small. If the memory grant is too large, we inhibit parallelism on the server. If it's too small, we may spill to disk, which is a costly operation. Memory grant feedback attempts to remember the memory needs of a prior execution (starting in [!INCLUDE [sssql22-md](../../includes/sssql22-md.md)], multiple executions) of a query and adjust the grant given to the query accordingly. This feature has been released in three waves. Batch mode memory grant feedback, followed by row mode memory grant feedback, and in [!INCLUDE [sssql22-md](../../includes/sssql22-md.md)], we're introducing memory grant feedback on-disk persistence using the Query Store and an improved algorithm known as percentile grant.
38+
Sometimes a query executes with a memory grant that is too large or too small. If the memory grant is too large, we inhibit parallelism on the server. If it's too small, we may spill to disk, which is a costly operation. Memory grant feedback attempts to remember the memory needs of a prior execution (with percentile feedback, multiple past executions). Based on this historical query information, memory grant feedback adjusts the grant given to the query accordingly for subsequent executions.
39+
40+
This feature has been released in three waves. Batch mode memory grant feedback, followed by row mode memory grant feedback, and in [!INCLUDE [sssql22-md](../../includes/sssql22-md.md)], we're introducing memory grant feedback on-disk persistence using the Query Store and an improved algorithm known as percentile grant.
3941

4042
### Batch mode memory grant feedback
4143

docs/relational-databases/performance/intelligent-query-processing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ The following table details all intelligent query processing features, along wit
4646
| [Interleaved Execution](intelligent-query-processing-details.md#interleaved-execution-for-mstvfs) | Yes, starting with database compatibility level 140| Yes, starting in [!INCLUDE[ssSQL17](../../includes/sssql17-md.md)] with database compatibility level 140|Uses the actual cardinality of the multi-statement table valued function encountered on first compilation instead of a fixed guess.|
4747
| [Memory grant feedback (Batch Mode)](intelligent-query-processing-feedback.md#batch-mode-memory-grant-feedback) | Yes, starting with database compatibility level 140| Yes, starting in [!INCLUDE[ssSQL17](../../includes/sssql17-md.md)] with database compatibility level 140|If a batch mode query has operations that spill to disk, add more memory for consecutive executions. If a query wastes > 50% of the memory allocated to it, reduce the memory grant size for consecutive executions.|
4848
| [Memory grant feedback (Row Mode)](intelligent-query-processing-feedback.md#row-mode-memory-grant-feedback) | Yes, starting with database compatibility level 150| Yes, starting in [!INCLUDE[sql-server-2019](../../includes/sssql19-md.md)] with database compatibility level 150|If a row mode query has operations that spill to disk, add more memory for consecutive executions. If a query wastes > 50% of the memory allocated to it, reduce the memory grant size for consecutive executions.|
49-
| [Memory grant feedback (Percentile)](intelligent-query-processing-feedback.md#percentile-and-persistence-mode-memory-grant-feedback) | No <!--Yes, starting with database compatibility level 160--> | Yes, starting with [!INCLUDE[sql-server-2022](../../includes/sssql22-md.md)]) with database compatibility level 140 | Addresses existing limitations of memory grant feedback in a non-intrusive way by incorporating past query execution to refine feedback. |
49+
| [Memory grant feedback (Percentile)](intelligent-query-processing-feedback.md#percentile-and-persistence-mode-memory-grant-feedback) | Yes, enabled on all databases | Yes, starting with [!INCLUDE[sql-server-2022](../../includes/sssql22-md.md)]) with database compatibility level 140 | Addresses existing limitations of memory grant feedback in a non-intrusive way by incorporating past query execution to refine feedback. |
5050
| [Memory Grant feedback persistence](intelligent-query-processing-feedback.md#percentile-and-persistence-mode-memory-grant-feedback) | Yes, enabled on all databases | Yes, starting with [!INCLUDE[sql-server-2022](../../includes/sssql22-md.md)]) with database compatibility level 140 | Provides new functionality to persist memory grant feedback. Requires Query Store to be enabled for the database and in READ_WRITE mode. |
5151
| [CE and DOP feedback persistence](intelligent-query-processing-feedback.md#percentile-and-persistence-mode-memory-grant-feedback) | No <!--Yes, starting with database compatibility level 160--> | Yes, starting with [!INCLUDE[sql-server-2022](../../includes/sssql22-md.md)]) with database compatibility level 140 | Requires Query Store to be enabled for the database and in READ_WRITE mode. |
5252
| [Optimized plan forcing](optimized-plan-forcing-query-store.md) | No <!--Yes, starting with database compatibility level 160--> | Yes, starting with [!INCLUDE[sql-server-2022](../../includes/sssql22-md.md)]). | Reduces compilation overhead for repeating forced queries. For more information, see [Optimized plan forcing with Query Store](optimized-plan-forcing-query-store.md). |

docs/t-sql/statements/alter-database-scoped-configuration-transact-sql.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ Allows you to enable or disable row mode memory grant feedback at the database s
331331
332332
#### MEMORY_GRANT_FEEDBACK_PERCENTILE_GRANT = { ON | OFF }
333333

334-
**Applies to:** [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] (Starting with [!INCLUDE[sql-server-2022](../../includes/sssql22-md.md)])
334+
**Applies to:** [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] (Starting with [!INCLUDE[sql-server-2022](../../includes/sssql22-md.md)]), [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)]
335335

336336
Allows you to disable memory grant feedback percentile for all query executions originating from the database. Default is **ON**. For complete information, see [Percentile and persistence mode memory grant feedback](../../relational-databases/performance/intelligent-query-processing-feedback.md#percentile-and-persistence-mode-memory-grant-feedback).
337337

@@ -340,7 +340,7 @@ Allows you to disable memory grant feedback percentile for all query executions
340340
341341
#### MEMORY_GRANT_FEEDBACK_PERSISTENCE = { ON | OFF }
342342

343-
**Applies to:** [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] (Starting with [!INCLUDE[sql-server-2022](../../includes/sssql22-md.md)])
343+
**Applies to:** [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] (Starting with [!INCLUDE[sql-server-2022](../../includes/sssql22-md.md)]), [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)]
344344

345345
Allows you to disable memory grant feedback persistence for all query executions originating from the database. Default is **ON**. For complete information, see [Percentile and persistence mode memory grant feedback](../../relational-databases/performance/intelligent-query-processing-feedback.md#percentile-and-persistence-mode-memory-grant-feedback).
346346

0 commit comments

Comments
 (0)