Slow Query Logs
Scenarios
Slow Query Logs 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.
If Intelligent O&M is not subscribed, records of a maximum of 1 hour can be retained.
Procedure
- Click
in the upper left corner and select a region. - Click
in the upper left corner of the page and choose Databases > Relational Database Service. - On the Instances page, click the DB instance name.
- In the navigation pane, choose SQL Analysis and Tunning under DBA Assistant.
- On the top of the page, click Log Settings, enable Collect Slow Query Logs, and set the slow query log threshold.
Figure 1 Log Settings
- View slow queries over time for the last 1 hour, last 3 hours, last 6 hours, last 12 hours, or a custom time period (spanning no more than one day), slow log details, and template statistics.
Figure 2 Slow query logs
- The collection of slow query logs is delayed for 1 to 3 minutes.
- You can search for slow query log details by database, client IP address, user, or execution duration.
- You can search for template information by database.
- To export slow query log details, click Export.
- To view log export history, click View All Export Records.
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