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: articles/mysql/concepts-server-logs.md
+61-2Lines changed: 61 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,8 +37,9 @@ Other parameters you can adjust include:
37
37
-**log_throttle_queries_not_using_indexes**: This parameter limits the number of non-index queries that can be written to the slow query log. This parameter takes effect when log_queries_not_using_indexes is set to ON.
38
38
-**log_output**: if "File", allows the slow query log to be written to both the local server storage and to Azure Monitor Diagnostic Logs. If "None", the slow query log will only be written to Azure Monitor Diagnostics Logs.
39
39
40
-
> [!Note]
41
-
> For `sql_text`, log will be truncated if it exceeds 2048 characters.
40
+
> [!IMPORTANT]
41
+
> If your tables are not indexed, setting the `log_queries_not_using_indexes` and `log_throttle_queries_not_using_indexes` parameters to ON may affect MySQL performance since all queries running against these non-indexed tables will be written to the slow query log.<br><br>
42
+
> If you plan on logging slow queries for an extended period of time, it is recommended to set `log_output` to "None". If set to "File", these logs are written to the local server storage and can affect MySQL performance.
42
43
43
44
See the MySQL [slow query log documentation](https://dev.mysql.com/doc/refman/5.7/en/slow-query-log.html) for full descriptions of the slow query log parameters.
44
45
@@ -78,5 +79,63 @@ The following table describes what's in each log. Depending on the output method
78
79
|`thread_id_s`| Thread ID |
79
80
|`\_ResourceId`| Resource URI |
80
81
82
+
> [!Note]
83
+
> For `sql_text`, log will be truncated if it exceeds 2048 characters.
84
+
85
+
## Analyze logs in Azure Monitor Logs
86
+
87
+
Once your slow query logs are piped to Azure Monitor Logs through Diagnostic Logs, you can perform further analysis of your slow queries. Below are some sample queries to help you get started. Make sure to update the below with your server name.
88
+
89
+
- Queries longer than 10 seconds on a particular server
90
+
91
+
```Kusto
92
+
AzureDiagnostics
93
+
| where LogicalServerName_s == '<your server name>'
0 commit comments