Skip to content

Commit 454ba0c

Browse files
authored
Merge pull request #33170 from MicrosoftDocs/main
2/13/2025 PM Publish
2 parents 5c903ac + 16e164b commit 454ba0c

File tree

4 files changed

+74
-56
lines changed

4 files changed

+74
-56
lines changed

azure-sql/database/automatic-tuning-overview.md

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
title: Automatic tuning overview
2+
title: Automatic Tuning Overview
33
titleSuffix: Azure SQL Database & Azure SQL Managed Instance
4-
description: Azure SQL Database and Azure SQL Managed Instance analyzes SQL query and automatically adapts to user workload.
4+
description: Automatic tuning analyzes SQL query and automatically adapts to user workload.
55
author: WilliamDAssafMSFT
66
ms.author: wiassaf
77
ms.reviewer: nnikolic, mathoma, derekw
8-
ms.date: 10/29/2024
8+
ms.date: 02/13/2025
99
ms.service: azure-sql
1010
ms.subservice: performance
1111
ms.topic: conceptual
@@ -15,34 +15,43 @@ ms.custom:
1515
monikerRange: "=azuresql || =azuresql-db || =azuresql-mi || =fabric"
1616
---
1717
# Automatic tuning in Azure SQL Database and Azure SQL Managed Instance
18+
1819
[!INCLUDE[appliesto-sqldb-sqlmi-fabricsqldb](../includes/appliesto-sqldb-sqlmi-fabricsqldb.md)]
1920

20-
Azure SQL Database and Azure SQL Managed Instance automatic tuning provides peak performance and stable workloads through continuous performance tuning based on AI and machine learning.
21+
Automatic tuning provides peak performance and stable workloads through continuous performance tuning based on AI and machine learning.
22+
23+
Automatic tuning is a fully managed, intelligent performance service that continuously monitors queries executed on a database, and automatically improves performance. This is achieved through dynamically adapting a database to changing workloads and applying tuning recommendations.
24+
25+
Automatic tuning learns horizontally from all databases on Azure through AI, and dynamically improves its tuning actions.
26+
27+
## Safe, reliable, and proven
28+
29+
Tuning operations applied to databases are fully safe for performance of your most intense workloads. The system has been designed with care not to interfere with user workloads.
30+
31+
:::image type="content" source="media/automatic-tuning-overview/how-does-automatic-tuning-work.png" alt-text="Diagram showing how automatic tuning works." lightbox="media/automatic-tuning-overview/how-does-automatic-tuning-work.png":::
2132

22-
Automatic tuning is a fully managed intelligent performance service that uses built-in intelligence to continuously monitor queries executed on a database and automatically improve their performance. This is achieved through dynamically adapting a database to changing workloads and applying tuning recommendations. Automatic tuning learns horizontally from all databases on Azure through AI, and dynamically improves its tuning actions. The longer a database runs with automatic tuning on, the better it performs.
33+
Automated tuning recommendations are applied only at the times of a low utilization of CPU, Data IO, and Log IO. The system can also temporarily disable automatic tuning operations to protect workload performance. In such case, "Disabled by the system" message will be shown in Azure portal and in [sys.database_automatic_tuning_options](/sql/relational-databases/system-catalog-views/sys-database-automatic-tuning-options-transact-sql) dynamic management view. Automatic tuning is designed to give user workloads the highest resource priority.
2334

24-
Azure SQL Database and Azure SQL Managed Instance automatic tuning might be one of the most impactful features that you can enable to provide stable and peak performing database workloads.
35+
Automatic tuning mechanisms are mature and have been perfected on several million databases running on Azure. Automated tuning operations applied are verified automatically to ensure there's a notable positive improvement to workload performance. If there's no improvement, or in the unlikely case performance regresses, changes made by automatic tuning are promptly reverted. Through the [tuning history](#automatic-tuning-history) recorded, there exists a clear trace of tuning improvements made to each database in Azure SQL Database. The longer a database runs with automatic tuning enabled, the more it might benefit.
2536

2637
Azure SQL automatic tuning shares its core logic with the SQL Server automatic tuning feature in the database engine. For additional technical information on the built-in intelligence mechanism, see [SQL Server automatic tuning](/sql/relational-databases/automatic-tuning/automatic-tuning).
2738

28-
## What can automatic tuning do for you
39+
> [!TIP]
40+
> For more information, see [Blog: Artificial Intelligence tunes Azure SQL Database](https://azure.microsoft.com/blog/artificial-intelligence-tunes-azure-sql-databases/).
41+
>
42+
> Read the Microsoft Research PDF on [automatically indexing millions of databases in Microsoft Azure SQL Database](https://www.microsoft.com/research/uploads/prod/2019/02/autoindexing_azuredb.pdf).
43+
44+
### What can automatic tuning do for you
45+
46+
Automated performance tuning of databases includes:
2947

30-
- Automated performance tuning of databases
3148
- Automated verification of performance gains
3249
- Automated rollback and self-correction
3350
- Tuning history
3451
- Tuning action Transact-SQL (T-SQL) scripts for manual deployments
3552
- Scale out capability on hundreds of thousands of databases
3653
- Positive impact to DevOps resources and the total cost of ownership
3754

38-
## Safe, reliable, and proven
39-
40-
Tuning operations applied to databases are fully safe for performance of your most intense workloads. The system has been designed with care not to interfere with user workloads. Automated tuning recommendations are applied only at the times of a low utilization of CPU, Data IO, and Log IO. The system can also temporarily disable automatic tuning operations to protect workload performance. In such case, "Disabled by the system" message will be shown in Azure portal and in [sys.database_automatic_tuning_options](/sql/relational-databases/system-catalog-views/sys-database-automatic-tuning-options-transact-sql) DMV. Automatic tuning is designed to give user workloads the highest resource priority.
41-
42-
Automatic tuning mechanisms are mature and have been perfected on several million databases running on Azure. Automated tuning operations applied are verified automatically to ensure there is a notable positive improvement to workload performance. If there is no improvement, or in the unlikely case performance regresses, changes made by automatic tuning are promptly reverted. Through the [tuning history](#automatic-tuning-history) recorded, there exists a clear trace of tuning improvements made to each database in Azure SQL Database.
43-
44-
![How does automatic tuning work](./media/automatic-tuning-overview/how-does-automatic-tuning-work.png)
45-
4655
## Enable automatic tuning
4756

4857
- **Azure SQL Database**: [Enable automatic tuning in the Azure portal](automatic-tuning-enable.md) or by using the [ALTER DATABASE](/sql/t-sql/statements/alter-database-transact-sql-set-options?view=azuresqldb-current&preserve-view=true) T-SQL statement.
@@ -55,15 +64,15 @@ The automatic tuning options available in Azure SQL Database and Azure SQL Manag
5564

5665
| Automatic tuning option | Description | Single database and pooled database support | Instance database support |
5766
| ---| ---| --- | --- |
58-
|**CREATE INDEX**|Identifies indexes that may improve performance of your workload, creates indexes, and automatically verifies that performance of queries has improved. When recommending a new index, the system considers space available in the database. If index addition is estimated to increase space utilization to over 90% toward maximum data size, index recommendation is not generated. Once the system identifies a period of low utilization and starts to create an index, it will not pause or cancel this operation even if resource utilization unexpectedly increases. If index creation fails, it will be retried during a future period of low utilization. Index recommendations are not provided for tables where the clustered index or heap is larger than 10 GB.|Yes|No|
59-
|**DROP INDEX**|Drops unused (over the last 90 days) and duplicate indexes. Unique indexes, including indexes supporting primary key and unique constraints, are never dropped. This option may be automatically disabled when queries with index hints are present in the workload, or when the workload performs partition switching. On Premium and Business Critical service tiers, this option will never drop unused indexes, but will drop duplicate indexes, if any.|Yes|No|
67+
|**CREATE INDEX**|Identifies indexes that might improve performance of your workload, creates indexes, and automatically verifies that performance of queries has improved. When recommending a new index, the system considers space available in the database. If index addition is estimated to increase space utilization to over 90% toward maximum data size, index recommendation isn't generated. Once the system identifies a period of low utilization and starts to create an index, it will not pause or cancel this operation even if resource utilization unexpectedly increases. If index creation fails, it will be retried during a future period of low utilization. Index recommendations aren't provided for tables where the clustered index or heap is larger than 10 GB.|Yes|No|
68+
|**DROP INDEX**|Drops unused (over the last 90 days) and duplicate indexes. Unique indexes, including indexes supporting primary key and unique constraints, are never dropped. This option can be automatically disabled when queries with index hints are present in the workload, or when the workload performs partition switching. On Premium and Business Critical service tiers, this option will never drop unused indexes, but will drop duplicate indexes, if any.|Yes|No|
6069
|**FORCE LAST GOOD PLAN** (automatic plan correction)|Identifies Azure SQL queries using an execution plan that is slower than the previous good plan, and forces queries to use the last known good plan instead of the regressed plan.|Yes|Yes|
6170

6271
### Automatic tuning for Azure SQL Database
6372

64-
Automatic tuning for Azure SQL Database uses the **[CREATE INDEX](/sql/t-sql/statements/create-index-transact-sql?view=azuresqldb-current&preserve-view=true)**, **[DROP INDEX](/sql/t-sql/statements/drop-index-transact-sql?view=azuresqldb-current&preserve-view=true)**, and **FORCE_LAST_GOOD_PLAN** database advisor recommendations to optimize your database performance. For more information, see [Database advisor recommendations in the Azure portal](database-advisor-find-recommendations-portal.md), in [PowerShell](/powershell/module/az.sql/get-azsqldatabaserecommendedaction), and in the [REST API](/rest/api/sql/server-automatic-tuning).
73+
Automatic tuning for Azure SQL Database uses the **[CREATE INDEX](/sql/t-sql/statements/create-index-transact-sql?view=azuresqldb-current&preserve-view=true)**, **[DROP INDEX](/sql/t-sql/statements/drop-index-transact-sql?view=azuresqldb-current&preserve-view=true)**, and **FORCE_LAST_GOOD_PLAN** database advisor recommendations to optimize your database performance. For more information, see [Find and apply performance recommendations in the Azure portal](database-advisor-find-recommendations-portal.md), in [PowerShell](/powershell/module/az.sql/get-azsqldatabaserecommendedaction), and in the [REST API](/rest/api/sql/server-automatic-tuning).
6574

66-
You can either manually apply tuning recommendations using the Azure portal, or you can let automatic tuning autonomously apply tuning recommendations for you. The benefits of letting the system autonomously apply tuning recommendations for you is that it automatically validates there exists a positive gain to workload performance, and if there is no significant performance improvement detected or if performance regresses, the system automatically reverts the changes that were made. Depending on query execution frequency, the validation process can take from 30 minutes to 72 hours, taking longer for less frequently executing queries. If at any point during validation a regression is detected, changes are reverted immediately.
75+
You can either manually apply tuning recommendations using the Azure portal, or you can let automatic tuning autonomously apply tuning recommendations for you. The benefits of letting the system autonomously apply tuning recommendations for you is that it automatically validates there exists a positive gain to workload performance, and if there's no significant performance improvement detected or if performance regresses, the system automatically reverts the changes that were made. Depending on query execution frequency, the validation process can take from 30 minutes to 72 hours, taking longer for less frequently executing queries. If at any point during validation a regression is detected, changes are reverted immediately.
6776

6877
> [!IMPORTANT]
6978
> In case you are applying tuning recommendations through T-SQL, the automatic performance validation and reversal mechanisms are not available. Recommendations applied in such way will remain active and shown in the list of tuning recommendations for 24-48 hours before the system automatically withdraws them. If you would like to remove a recommendation sooner, you can discard it from Azure portal.
@@ -89,13 +98,16 @@ For more information, see [ALTER DATABASE SET options](/sql/t-sql/statements/alt
8998
To inherit the default configuration from the parent logical server, use the following T-SQL. In the Azure portal, this reflects the option to "Inherit from: Server".
9099

91100
```sql
92-
ALTER DATABASE CURRENT SET AUTOMATIC_TUNING = INHERIT;
101+
ALTER DATABASE CURRENT
102+
SET AUTOMATIC_TUNING = INHERIT;
93103
```
94104

95105
To enable the **CREATE INDEX** and **DROP INDEX** automatic tuning options, use the following T-SQL.
96106

97107
```sql
98-
ALTER DATABASE CURRENT SET AUTOMATIC_TUNING (CREATE_INDEX = ON, DROP_INDEX = ON);
108+
ALTER DATABASE CURRENT
109+
SET AUTOMATIC_TUNING
110+
(CREATE_INDEX = ON, DROP_INDEX = ON);
99111
```
100112

101113
## Automatic tuning history
@@ -104,6 +116,4 @@ For Azure SQL Database, the history of changes made by automatic tuning is retai
104116

105117
## Related content
106118

107-
- Read the blog post [Artificial Intelligence tunes Azure SQL Database](https://azure.microsoft.com/blog/artificial-intelligence-tunes-azure-sql-databases/).
108-
- Learn how automatic tuning works under the hood in [Automatically indexing millions of databases in Microsoft Azure SQL Database](https://www.microsoft.com/research/uploads/prod/2019/02/autoindexing_azuredb.pdf).
109119
- Learn how automatic tuning can proactively help you [Diagnose and troubleshoot high CPU on Azure SQL Database](high-cpu-diagnose-troubleshoot.md)

0 commit comments

Comments
 (0)