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.
Procedure
- Log in to the management 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