You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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":::
21
32
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.
23
34
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.
25
36
26
37
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).
27
38
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:
29
47
30
-
- Automated performance tuning of databases
31
48
- Automated verification of performance gains
32
49
- Automated rollback and self-correction
33
50
- Tuning history
34
51
- Tuning action Transact-SQL (T-SQL) scripts for manual deployments
35
52
- Scale out capability on hundreds of thousands of databases
36
53
- Positive impact to DevOps resources and the total cost of ownership
37
54
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
-

45
-
46
55
## Enable automatic tuning
47
56
48
57
-**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
55
64
56
65
| Automatic tuning option | Description | Single database and pooled database support | Instance database support |
57
66
| ---| ---| --- | --- |
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|
60
69
|**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|
61
70
62
71
### Automatic tuning for Azure SQL Database
63
72
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).
65
74
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.
67
76
68
77
> [!IMPORTANT]
69
78
> 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
89
98
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".
90
99
91
100
```sql
92
-
ALTERDATABASE CURRENT SET AUTOMATIC_TUNING = INHERIT;
101
+
ALTERDATABASE CURRENT
102
+
SET AUTOMATIC_TUNING = INHERIT;
93
103
```
94
104
95
105
To enable the **CREATE INDEX** and **DROP INDEX** automatic tuning options, use the following T-SQL.
96
106
97
107
```sql
98
-
ALTERDATABASE CURRENT SET AUTOMATIC_TUNING (CREATE_INDEX =ON, DROP_INDEX =ON);
108
+
ALTERDATABASE CURRENT
109
+
SET AUTOMATIC_TUNING
110
+
(CREATE_INDEX =ON, DROP_INDEX =ON);
99
111
```
100
112
101
113
## Automatic tuning history
@@ -104,6 +116,4 @@ For Azure SQL Database, the history of changes made by automatic tuning is retai
104
116
105
117
## Related content
106
118
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).
109
119
- 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