Slow Query Logs
Slow Query Log displays a chart of SQL statements that are taking too long to execute and allows you to sort slow SQL statements by multiple dimensions, such as by user, client IP address, or SQL template. It helps you quickly identify bottlenecks and improve instance performance.
Usage Notes
- Slow query logs of free instances are retained for only one hour. If you have subscribed to Intelligent O&M for paid and free instances, their slow query logs are retained for seven days by default and can be retained for up to 30 days. After the retention period expires, slow query logs are deleted.
- You can enable the slow query logs function for a maximum of 10 free instances. There is no such a limit on paid instances.
- For free instances, you can only view slow query logs generated in the latest hour.
Procedure
- Log in to the DAS console.
- Click in the upper left corner and select a region and project.
- Click in the upper left corner, and under Databases, click Data Admin Service.
- In the navigation pane, choose Intelligent O&M > Instance List.
Alternatively, on the Overview page, click Go to Intelligent O&M.
- In the upper right corner of the Instance List page, search for instances by engine type, instance name, or instance IP.
Figure 1 Searching for instances
- Locate the box containing your target instance and click Details.
- Choose SQL > Slow Query Logs.
You can click to enable Collect Slow Query Logs.
You can also click Log Settings in the upper right corner of the page to enable Collect Slow Query Logs.
On the SQL Query Logs tab page, you can select a time range (last hour, last 3 hours, last 12 hours, or a user-defined time range which must be within three days) to view slow queries in the time range. You can view slow query logs over time, as well as slow query log statistics and details.
- The Slow Queries over Time chart displays slow query logs in the specified time period.
Figure 2 Slow queries over time
- Statistics shows slow query logs by node, SQL statement type, database, data table, user, and client.
Figure 3 Slow query log statistics
- Slow query log details include the execution completion time, SQL statement, SQL statement type, database, database table, client IP address, user, execution duration, lock wait time, scanned documents, returned documents, and scanned indexes.
Figure 4 Slow query log details
Above the chart, you can switch to another instance or node to view slow query logs by instance or by node.
- The Slow Queries over Time chart displays slow query logs in the specified time period.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot