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
You can also create a [SQL database in Microsoft Fabric](/sql/sql-server/fabric-database/sql-database-in-fabric). A [SQL database in Microsoft Fabric is distinct from an Azure SQL Database](/fabric/database/sql/decision-guide) or a mirrored database from Azure SQL Database, and each use similar mirroring technology to replicate data into Microsoft Fabric's OneLake.
177
+
178
+
With [SQL database in Fabric](/fabric/database/sql/overview), your data is automatically accessible from other Fabric experiences. SQL database in Microsoft Fabric, which uses the same SQL Database Engine as Microsoft SQL Server and is similar to Azure SQL Database, inherits most of the Fabric mirroring capabilities from Azure SQL Database. Your SQL database in Fabric is automatically mirrored to OneLake and presented in a read-only, queryable format. You can use all the different services in Fabric, such as running analytics with Spark, executing notebooks, data engineering, visualizing through Power BI Reports, and more.
179
+
180
+
For more information, see [SQL database in Microsoft Fabric (Preview)](/sql/sql-server/fabric-database/sql-database-in-fabric).
This article describes the **max degree of parallelism (MAXDOP)** configuration setting in Azure SQL Database.
23
+
This article describes the **max degree of parallelism (MAXDOP)** configuration setting in Azure SQL Database and SQL database in Fabric.
24
24
25
25
> [!NOTE]
26
-
> **This content is focused on Azure SQL Database.** Azure SQL Database is based on the latest stable version of the Microsoft SQL Server database engine, so much of the content is similar though troubleshooting and configuration options differ. For more on MAXDOP in SQL Server, see [Configure the max degree of parallelism Server Configuration Option](/sql/database-engine/configure-windows/configure-the-max-degree-of-parallelism-server-configuration-option).
26
+
> **This content is focused on Azure SQL Database and SQL database in Fabric.** Azure SQL Database is based on the latest stable version of the Microsoft SQL Server database engine, so much of the content is similar though troubleshooting and configuration options differ. For more on MAXDOP in SQL Server and Azure SQL Managed Instance, see [Configure the max degree of parallelism Server Configuration Option](/sql/database-engine/configure-windows/configure-the-max-degree-of-parallelism-server-configuration-option).
27
27
28
28
MAXDOP controls intra-query parallelism in the database engine. Higher MAXDOP values generally result in more parallel threads per query, and faster query execution.
29
29
30
-
In Azure SQL Database, the default MAXDOP setting for each new single database and elastic pool database is 8. This default prevents unnecessary resource utilization, while still allowing the database engine to execute queries faster using parallel threads. It is not typically necessary to further configure MAXDOP in Azure SQL Database workloads, though it might provide benefits as an advanced performance tuning exercise.
30
+
In Azure SQL Database and SQL database in Fabric, the default MAXDOP setting for each new single database and elastic pool database is 8. This default prevents unnecessary resource utilization, while still allowing the database engine to execute queries faster using parallel threads. It is not typically necessary to further configure MAXDOP in Azure SQL Database workloads, though it might provide benefits as an advanced performance tuning exercise.
31
31
32
32
> [!Note]
33
33
> In September 2020, based on years of telemetry in the Azure SQL Database service MAXDOP 8 was made the [default for new databases](https://techcommunity.microsoft.com/blog/azuresqlblog/changing-default-maxdop-in-azure-sql-database-and-azure-sql-managed-instance/1538528), as the optimal value for the widest variety of customer workloads. This default helped prevent performance problems due to excessive parallelism. Prior to that, the default setting for new databases was `MAXDOP 0`. MAXDOP was not automatically changed for existing databases created prior to September 2020.
- In Azure SQL Database, you can change the default MAXDOP value:
54
+
- In Azure SQL Database and SQL database in Fabric, you can change the default MAXDOP value:
55
55
- At the query level, using the **MAXDOP**[query hint](/sql/t-sql/queries/hints-transact-sql-query).
56
56
- At the database level, using the **MAXDOP**[database scoped configuration](/sql/t-sql/statements/alter-database-scoped-configuration-transact-sql).
57
57
58
-
- Long-standing SQL Server MAXDOP considerations and [recommendations](/sql/database-engine/configure-windows/configure-the-max-degree-of-parallelism-server-configuration-option#Guidelines) are applicable to Azure SQL Database.
58
+
- Long-standing SQL Server MAXDOP considerations and [recommendations](/sql/database-engine/configure-windows/configure-the-max-degree-of-parallelism-server-configuration-option#Guidelines) are applicable to Azure SQL Database and SQL database in Fabric.
59
59
60
60
- Index operations that create or rebuild an index, or that drop a clustered index, can be resource intensive. You can override the database MAXDOP value for index operations by specifying the MAXDOP index option in the `CREATE INDEX` or `ALTER INDEX` statement. The MAXDOP value is applied to the statement at execution time and is not stored in the index metadata. For more information, see [Configure Parallel Index Operations](/sql/relational-databases/indexes/configure-parallel-index-operations).
> We recommend that customers avoid setting MAXDOP to 0 even if it does not appear to cause problems currently.
76
76
77
-
Excessive parallelism becomes most problematic when there are more concurrent requests than can be supported by the CPU and worker thread resources provided by the service objective. Avoid `MAXDOP 0` to reduce the risk of potential future problems due to excessive parallelism if a database is scaled up, or if future hardware configurations in Azure SQL Database provide more cores for the same database service objective.
77
+
Excessive parallelism becomes most problematic when there are more concurrent requests than can be supported by the CPU and worker thread resources provided by the service objective. Avoid `MAXDOP 0` to reduce the risk of potential future problems due to excessive parallelism if a database is scaled up, or if future hardware configurations provide more cores for the same database service objective.
78
78
79
79
<aid="modifying-maxdop"></a>
80
80
81
81
### Modify MAXDOP
82
82
83
-
If you determine that a MAXDOP setting different from the default is optimal for your Azure SQL Database workload, you can use the `ALTER DATABASE SCOPED CONFIGURATION` T-SQL statement. For examples, see the [Examples using Transact-SQL](#examples) section below. To change MAXDOP to a non-default value for each new database you create, add this step to your database deployment process.
83
+
If you determine that a MAXDOP setting different from the default is optimal for your workload, you can use the `ALTER DATABASE SCOPED CONFIGURATION` T-SQL statement. For examples, see the [Examples using Transact-SQL](#examples) section below. To change MAXDOP to a non-default value for each new database you create, add this step to your database deployment process.
84
84
85
85
If non-default MAXDOP benefits only a small subset of queries in the workload, you can override MAXDOP at the query level by adding the `OPTION (MAXDOP)` hint. For examples, see [Examples using Transact-SQL](#examples).
These examples use the latest `AdventureWorksLT` sample database when the `SAMPLE` option is chosen for a new single database of Azure SQL Database.
101
+
These examples use the latest `AdventureWorksLT` sample database when the `SAMPLE` option is chosen for a new single database.
102
102
103
103
### PowerShell
104
104
@@ -150,7 +150,7 @@ $params = @{
150
150
151
151
### Transact-SQL
152
152
153
-
You can use the [Azure portal query editor for Azure SQL Database](query-editor.md), [SQL Server Management Studio (SSMS)](/sql/ssms/download-sql-server-management-studio-ssms), or [Azure Data Studio](/azure-data-studio/download-azure-data-studio) to execute T-SQL queries against your Azure SQL Database.
153
+
You can use the [Azure portal query editor for Azure SQL Database](query-editor.md), [SQL Server Management Studio (SSMS)](/sql/ssms/download-sql-server-management-studio-ssms), the [mssql extension](https://aka.ms/mssql-marketplace) for [Visual Studio Code](https://code.visualstudio.com/docs), or the [SQL query editor in the Fabric portal](/fabric/database/sql/query-editor) to execute T-SQL queries.
@@ -156,13 +156,19 @@ A recompilation (or fresh compilation after cache eviction) can still result in
156
156
157
157
Slow query performance not related to suboptimal query plans and missing indexes are generally related to insufficient or overused resources. If the query plan is optimal, the query (and the database) might be hitting the resource limits for the database or elastic pool. An example might be excess log write throughput for the service level.
158
158
159
-
- Detecting resource issues using the Azure portal: To see if resource limits are the problem, see [SQL Database resource monitoring](monitor-tune-overview.md#azure-sql-database-and-azure-sql-managed-instance-resource-monitoring). For single databases and elastic pools, see [Database Advisor performance recommendations](database-advisor-implement-performance-recommendations.md) and [Query Performance Insights](query-performance-insight-use.md).
160
-
- Detecting resource limits using [database watcher](../database-watcher-overview.md).
161
-
- Detecting resource issues using [DMVs](monitoring-with-dmvs.md):
159
+
- Detect performance issues:
160
+
- For Azure SQL Database, use the Azure portal: To see if resource limits are the problem, see [SQL Database resource monitoring](monitor-tune-overview.md#azure-sql-database-and-azure-sql-managed-instance-resource-monitoring). For single databases and elastic pools, see [Database Advisor performance recommendations](database-advisor-implement-performance-recommendations.md) and [Query Performance Insights](query-performance-insight-use.md).
161
+
- For SQL database in Microsoft Fabric, use the Fabric portal: Review the [Performance Dashboard](/fabric/database/sql/performance-dashboard) for the performance status of the database and metrics visibility, including configurable alerts, queries, automatic indexing activity, and more.
162
+
163
+
- Detect resource limits and utilization:
164
+
- For Azure SQL Database, use [database watcher](../database-watcher-overview.md). Currently, database watcher is available in Azure SQL Database only.
165
+
- For SQL database in Microsoft Fabric, use the [Microsoft Fabric Capacity Metrics app](/fabric/database/sql/usage-reporting).
166
+
167
+
- Detect resource issues using [DMVs](monitoring-with-dmvs.md):
162
168
163
169
- The [sys.dm_db_resource_stats](monitoring-with-dmvs.md#monitor-resource-use) DMV returns CPU, I/O, and memory consumption for the database. One row exists for every 15-second interval, even if there's no activity in the database. Historical data is maintained for one hour.
164
170
- The [sys.resource_stats](monitoring-with-dmvs.md#monitor-resource-use) DMV returns CPU usage and storage data for Azure SQL Database. The data is collected and aggregated in five-minute intervals.
165
-
-[Many individual queries that cumulatively consume high CPU](monitoring-with-dmvs.md#many-individual-queries-that-cumulatively-consume-high-cpu)
171
+
-Use DMVs to monitor database activity, including for example looking for [individual queries that cumulatively consume high CPU](monitoring-with-dmvs.md#many-individual-queries-that-cumulatively-consume-high-cpu).
166
172
167
173
If you identify the problem as insufficient resource, you can upgrade resources to increase the capacity of your database to absorb the CPU requirements. For more information, see [Scale single database resources in Azure SQL Database](single-database-scale.md) and [Scale elastic pool resources in Azure SQL Database](elastic-pool-scale.md).
Temporal tables might increase database size more than regular tables, especially if you retain historical data for a longer period of time. Hence, retention policy for historical data is an important aspect of planning and managing the lifecycle of every temporal table. Temporal tables in Azure SQL Database and Azure SQL Managed Instance come with easy-to-use retention mechanism that helps you accomplish this task.
@@ -71,7 +71,7 @@ To read and write event data, the [!INCLUDE [ssde-md](../../docs/includes/ssde-m
71
71
72
72
# [SQL Database](#tab/sqldb)
73
73
74
-
Create a database-scoped [credential](/sql/relational-databases/security/authentication-access/credentials-database-engine). Using a client tool such as SSMS, open a new query window, connect to the database where you create the event session, and paste the following T-SQL batch. Make sure you're connected to your user database, and not to the `master` database.
74
+
In Azure SQL Database and SQL database in Microsoft Fabric, create a database-scoped [credential](/sql/relational-databases/security/authentication-access/credentials-database-engine). Using a client tool such as SSMS, open a new query window, connect to the database where you create the event session, and paste the following T-SQL batch. Make sure you're connected to your user database, and not to the `master` database.
75
75
76
76
> [!NOTE]
77
77
> Executing the following T-SQL batch requires the `CONTROL` database permission, which is held by the database owner (`dbo`), by the members of the `db_owner` database role, and by the administrator of the logical server.
0 commit comments