Skip to content

Commit cdc0d34

Browse files
authored
Merge pull request #20252 from WilliamDAssafMSFT/20210920-aprc-caveat
20210920 RE: APRC Plan Forcing Doc Updates
2 parents 71bcfbc + e6c2b88 commit cdc0d34

4 files changed

Lines changed: 45 additions & 39 deletions

File tree

docs/relational-databases/automatic-tuning/automatic-tuning.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Automatic tuning"
33
description: Learn about automatic tuning in SQL Server and Azure SQL Database
44
ms.custom: "fasttrack-edit"
5-
ms.date: "03/12/2021"
5+
ms.date: "09/20/2021"
66
ms.prod: sql
77
ms.prod_service: "database-engine, sql-database"
88
ms.reviewer: ""
@@ -67,7 +67,9 @@ The [!INCLUDE[ssde_md](../../includes/ssde_md.md)] can automatically switch to t
6767

6868
![Query execution plan choice correction](media/force-last-good-plan.png "Query execution plan choice correction")
6969

70-
The [!INCLUDE[ssde_md](../../includes/ssde_md.md)] automatically detects any potential plan choice regression, including the plan that should be used instead of the wrong plan. When the [!INCLUDE[ssde_md](../../includes/ssde_md.md)] applies the last known good plan before the regression occurred, it automatically monitors the performance of the forced plan. If the forced plan is not better than the regressed plan, the new plan will be unforced and the [!INCLUDE[ssde_md](../../includes/ssde_md.md)] will compile a new plan. If the [!INCLUDE[ssde_md](../../includes/ssde_md.md)] verifies that the forced plan is better than the regressed plan, the forced plan will be retained. It will be retained until a recompile occurs (for example, on the next statistics update or schema change). For more information about plan forcing and types of plans that can be forced, see [Plan forcing limitations](../../relational-databases/system-catalog-views/sys-query-store-plan-transact-sql.md#plan-forcing-limitations).
70+
The [!INCLUDE[ssde_md](../../includes/ssde_md.md)] automatically detects any potential plan choice regression, including the plan that should be used instead of the wrong plan. The resulting execution plan forced by automatic plan correction will be the same or similar to the last known good plan. Because the resulting plan may not be identical to the last know good plan, the performance of forced plan may vary. In rare cases, the performance difference may be significant and negative; in this case, automatic plan correction will automatically stop attempting to force the replacement plan.
71+
72+
When the [!INCLUDE[ssde_md](../../includes/ssde_md.md)] applies the last known good plan before the regression occurred, it automatically monitors the performance of the forced plan. If the forced plan is not better than the regressed plan, the new plan will be unforced and the [!INCLUDE[ssde_md](../../includes/ssde_md.md)] will compile a new plan. If the [!INCLUDE[ssde_md](../../includes/ssde_md.md)] verifies that the forced plan is better than the regressed plan, the forced plan will be retained. It will be retained until a recompile occurs (for example, on the next statistics update or schema change). For more information about plan forcing and types of plans that can be forced, see [Plan forcing limitations](../../relational-databases/system-catalog-views/sys-query-store-plan-transact-sql.md#plan-forcing-limitations).
7173

7274
> [!NOTE]
7375
> If the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] instance is restarted before a plan forcing action is verified, that plan will be automatically unforced. Otherwise, plan forcing is persisted on [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] restarts.

docs/relational-databases/performance/plan-guides.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
title: "Plan Guides | Microsoft Docs"
2+
title: "Plan Guides"
33
description: Learn about plan guides, which let you optimize the performance of queries without directly changing the text of the query in SQL Server.
44
ms.custom: ""
5-
ms.date: "03/14/2017"
5+
ms.date: "09/20/2021"
66
ms.prod: sql
77
ms.reviewer: ""
88
ms.technology: performance
@@ -17,7 +17,6 @@ helpviewer_keywords:
1717
- "OPTION clause"
1818
- "plan guides [SQL Server]"
1919
- "USE PLAN query hint"
20-
ms.assetid: bfc97632-c14c-4768-9dc5-a9c512f6b2bd
2120
author: WilliamDAssafMSFT
2221
ms.author: wiassaf
2322
---
@@ -27,6 +26,8 @@ ms.author: wiassaf
2726

2827
The total number of plan guides you can create is limited only by available system resources. Nevertheless, plan guides should be limited to mission-critical queries that are targeted for improved or stabilized performance. Plan guides should not be used to influence most of the query load of a deployed application.
2928

29+
The resulting execution plan forced by this feature will be the same or similar to the plan being forced. Because the resulting plan may not be identical to the plan specified by the plan guide, the performance of the plans may vary. In rare cases, the performance difference may be significant and negative; in that case, the administrator must remove the forced plan.
30+
3031
> [!NOTE]
3132
> Plan guides cannot be used in every edition of [!INCLUDE[msCoName](../../includes/msconame-md.md)] [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. For a list of features that are supported by the editions of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], see [Features Supported by the Editions of SQL Server 2016](~/sql-server/editions-and-supported-features-for-sql-server-2016.md). Plan guides are visible in any edition. You can also attach a database that contains plan guides to any edition. Plan guides remain intact when you restore or attach a database to an upgraded version of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)].
3233

docs/relational-databases/system-stored-procedures/sp-query-store-force-plan-transact-sql.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
description: "sp_query_store_force_plan (Transact-SQL)"
3-
title: "sp_query_store_force_plan (Transact-SQL) | Microsoft Docs"
3+
title: "sp_query_store_force_plan (Transact-SQL)"
44
ms.custom: ""
5-
ms.date: "03/29/2016"
5+
ms.date: "09/20/2021"
66
ms.prod: sql
77
ms.prod_service: "database-engine, sql-database"
88
ms.reviewer: ""
@@ -18,7 +18,6 @@ dev_langs:
1818
helpviewer_keywords:
1919
- "sys.sp_query_store_force_plan"
2020
- "sp_query_store_force_plan"
21-
ms.assetid: 0068f258-b998-4e4e-b47b-e375157c8213
2221
author: markingmyname
2322
ms.author: maghan
2423
monikerRange: "=azuresqldb-current||>=sql-server-2016||>=sql-server-linux-2017||=azuresqldb-mi-current"
@@ -35,22 +34,23 @@ Enables forcing a particular plan for a particular query.
3534

3635
## Syntax
3736

38-
```
37+
```syntaxsql
3938
sp_query_store_force_plan [ @query_id = ] query_id , [ @plan_id = ] plan_id [;]
4039
```
4140

4241
## Arguments
43-
`[ @query_id = ] query_id`
42+
#### `[ @query_id = ] query_id`
4443
Is the id of the query. *query_id* is a **bigint**, with no default.
4544

46-
`[ @plan_id = ] plan_id`
45+
#### `[ @plan_id = ] plan_id`
4746
Is the id of the query plan to be forced. *plan_id* is a **bigint**, with no default.
4847

4948
## Return Code Values
5049
0 (success) or 1 (failure)
5150

5251
## Remarks
53-
52+
The resulting execution plan forced by this feature will be the same or similar to the plan being forced. Because the resulting plan may not be identical to the plan specified by `sp_query_store_force_plan`, the performance of the plans may vary. In rare cases, the performance difference may be significant and negative; in that case, the administrator must remove the forced plan.
53+
5454
## Permissions
5555
Requires the **ALTER** permission on the database.
5656

0 commit comments

Comments
 (0)