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
Copy file name to clipboardExpand all lines: support/azure/synapse-analytics/dedicated-sql/query-execution-performance/dsql-perf-common-query-errors.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,10 @@ title: Troubleshoot Common Query Execution Errors on an Azure Synapse Dedicated
3
3
description: Provides a reference of the most common errors and recommendations for query execution on an Azure Synapse dedicated SQL pool.
Copy file name to clipboardExpand all lines: support/azure/synapse-analytics/dedicated-sql/query-execution-performance/troubleshoot-dsql-perf-slow-query.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,13 +3,13 @@ title: Troubleshoot Slow Queries on a Dedicated SQL Pool
3
3
description: Describes the troubleshooting steps and mitigations for the common performance issues of queries run on an Azure Synapse Analytics dedicated SQL pool.
4
4
author: dialmoth
5
5
ms.author: dialmoth
6
-
ms.reviewer: goventur, wiassaf
7
-
ms.date: 01/30/2025
6
+
ms.reviewer: goventur, wiassaf, dialmoth
7
+
ms.date: 02/05/2025
8
8
ms.custom:
9
-
- "sap:Query Execution and Performance"
9
+
- sap:Query Execution and Performance
10
10
---
11
11
12
-
# Troubleshoot a slow query on a dedicated SQL Pool
12
+
# Troubleshoot a slow query on a dedicated SQL pool
13
13
14
14
_Applies to:_ Azure Synapse Analytics
15
15
@@ -28,7 +28,7 @@ Follow the steps to troubleshoot the issue or execute the steps in the notebook
> To save troubleshooting time, make sure that the statistics are [created and up-to-date](/azure/synapse-analytics/sql/develop-tables-statistics#update-statistics) and [rebuild clustered columnstore indexes in the dedicated SQL pool](dsql-perf-cci-health.md).
31
+
> To save troubleshooting time, make sure that the statistics are [created and up-to-date](/azure/synapse-analytics/sql/develop-tables-statistics#update-statistics) and [rebuild clustered columnstore indexes in the dedicated SQL pool](dsql-perf-cci-health.md).
@@ -66,12 +66,12 @@ To better target the slow queries, use the following tips when you run the scrip
66
66
67
67
## Step 2: Determine where the query is taking time
68
68
69
-
Run the following script to find the step that might cause the performance issue of the query. Update the variables in the script with the values described in the following table. Change the `@ShowActiveOnly` value to 0 to get the full picture of the distributed plan. Take note of the `StepIndex`, `Phase`, and `Description` values of the slow step identified from the result set.
69
+
Run the following script to find the step that might cause the performance issue of the query. Update the variables in the script with the values described in the following table. Change the `@ShowActiveOnly` value to `0` to get the full picture of the distributed plan. Take note of the `StepIndex`, `Phase`, and `Description` values of the slow step identified from the result set.
70
70
71
71
| Parameter | Description |
72
72
| --- | ---- |
73
-
|`@QID`| The `request_id` value obtained in [Step 1](#step-1-identify-the-request_id-aka-qid)|
74
-
|`@ShowActiveOnly`|`0`- Show all steps for the query<br/>`1`- Show only the currently active step |
73
+
|`@QID`| The `request_id` value is obtained in [Step 1](#step-1-identify-the-request_id-aka-qid).|
74
+
|`@ShowActiveOnly`|Setting the value to `0`shows all steps for the query.<br/>Setting the value to `1`shows only the currently active step.|
Run the following script to review the details of the step identified in the previous step. Update the variables in the script with the values described in the following table. Change the `@ShowActiveOnly` value to 0 to compare all distribution timings. Take note of the `wait_type` value for the distribution that might cause the performance issue.
148
+
Run the following script to review the details of the step identified in the previous step. Update the variables in the script with the values described in the following table. Change the `@ShowActiveOnly` value to `0` to compare all distribution timings. Take note of the `wait_type` value for the distribution that might cause the performance issue.
149
149
150
150
| Parameter | Description |
151
151
| -- | ---- |
152
-
|`@QID`| The `request_id` value obtained in [Step 1](#step-1-identify-the-request_id-aka-qid)|
153
-
|`@StepIndex`| The `StepIndex` value identified in [Step 2](#step-2-determine-where-the-query-is-taking-time)|
154
-
|`@ShowActiveOnly`|`0`- Show all distributions for the given `StepIndex` value<br/>`1`- Show only the currently active distributions for the given `StepIndex` value |
152
+
|`@QID`| The `request_id` value is obtained in [Step 1](#step-1-identify-the-request_id-aka-qid).|
153
+
|`@StepIndex`| The `StepIndex` value is identified in [Step 2](#step-2-determine-where-the-query-is-taking-time).|
154
+
|`@ShowActiveOnly`|Setting the value to `0`shows all distributions for the given `StepIndex` value.<br/>Setting the value to `1`shows only the currently active distributions for the given `StepIndex` value.|
@@ -450,9 +450,9 @@ Unhealthy CCIs contribute to increased IO, CPU, and memory allocation, which, in
450
450
451
451
Outdated statistics can cause the generation of an unoptimized distributed plan, which involves more data movement than necessary. Unnecessary data movement increases the workload not only on your data at rest but also on the `tempdb`. Because IO is a shared resource across all queries, performance impacts can be felt by the entire workload.
452
452
453
-
The optimizer relies on statistics to estimate the number of rows that will be returned by a query. Statistics allow the query optimizer to choose the most efficient plan, or the best move operation to perform (for example, a Shuffle Move Operation or Broad Cast Move Operation) to align the data during the join condition. The best join condition depends on the table distribution type.
453
+
The optimizer relies on statistics to estimate the number of rows that will be returned by a query. Statistics allow the query optimizer to choose the most efficient plan or perform the best move operation (for example, a Shuffle Move Operation or Broad Cast Move Operation) to align the data during the join condition. The best join condition depends on the table distribution type.
454
454
455
-
For example, if the actual number of rows for a given table is 60 million, and the estimated number of rows is 1,000 (at control node level), the optimizer might choose a Broadcast move operation. This is because the cost is perceived to be lower compared to a Shuffle Move, given the optimizer's assumption that the table contains only 1,000 rows. However, once the actual execution begins, the engine will move 60 million rows as part of the execution using a Broadcast move, which can be an expensive operation considering both the data size and row count. Consequently, if the data size is substantial, it might lead to performance issues for the query itself and other queries, resulting in high CPU usage.
455
+
For example, if the actual number of rows for a given table is 60 million and the estimated number of rows is 1,000 (at control node level), the optimizer might choose a Broadcast move operation. This behavior is because the cost is perceived to be lower compared to a Shuffle Move, given the optimizer's assumption that the table contains only 1,000 rows. However, once the actual execution begins, the engine will move 60 million rows as part of the execution using a Broadcast move, which can be an expensive operation considering both the data size and row count. Consequently, if the data size is substantial, it might lead to performance issues for the query itself and other queries, resulting in high CPU usage.
456
456
457
457
To remedy this situation, ensure all [statistics are up-to-date](/azure/synapse-analytics/sql/develop-tables-statistics#update-statistics), and a maintenance plan is in place to keep them updated for user workloads. You can verify the accuracy of statistics by following the steps outlined in [Check statistics accuracy on a dedicated SQL pool](dsql-perf-stats-accuracy.md).
0 commit comments