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
# Troubleshoot and identify slow-running queries in Azure Database for PostgreSQL Elastic Clusters
14
14
15
-
This article describes how to identify and diagnose the root cause of slow-running queries, which can consume CPU resources and lead to high CPU utilization.
15
+
This article describes how to identify and diagnose the root cause of slow-running queries. These queries can consume CPU resources and lead to high CPU utilization.
16
16
17
17
## Identify the slow query
18
18
19
-
You can identify the slow query by using `pg_stat_statements`. The following query helps identify the top five slowest operations.
19
+
Use `pg_stat_statements` to identify the slow query. The following query helps you find the top five slowest operations.
Based on the preceding output, if the data is skewed to a few shards, the distribution key is likely the cause. In this case, consider rearchitecting the distribution key.
163
+
Based on the preceding output, if the data is skewed to a few shards, the distribution key is likely the cause. Consider rearchitecting the distribution key.
164
164
165
-
Here's a related talk on choosing the right shard key.[Efficiently distributing Postgres with Citus - How to choose the right shard key? | Citus Con 2022](https://www.youtube.com/watch?v=t0EXeWk3lAk)
165
+
Here's a related talk on choosing the right shard key:[Efficiently distributing Postgres with Citus - How to choose the right shard key? | Citus Con 2022](https://www.youtube.com/watch?v=t0EXeWk3lAk).
166
166
167
167
## Diagnose lock contention
168
168
@@ -249,8 +249,8 @@ SELECT * FROM run_command_on_all_nodes( $$ SELECT json_agg(t) FROM (
249
249
) t $$ );
250
250
```
251
251
252
-
> [!NOTE]
253
-
> This might happen when your server is restarted or scaled. In those cases, wait for your system to stabilize.
252
+
> [!NOTE]
253
+
> This condition might happen when your server restarts or scales. In those cases, wait for your system to stabilize.
0 commit comments