SQL Insights
The SQL Insights module allows you to query all executed SQL statements, as well as analyze and search for the tables that are accessed and updated most frequently, and the SQL statements that have the longest lock wait, helping you quickly identify exceptions and ensuring database stability.
Precautions
- You need to enable Collect All SQL Statements before using SQL Insights. Collecting all SQL statements generates a performance loss of no more than 5%.
- After Collect All SQL Statements is disabled, new SQL statements will not be collected anymore and the collected SQL data will be deleted.
- Some data cannot be recorded if a buffer overrun occurs.
- Any SQL statement that exceeds 4096 bytes is discarded by default.
This constraint can be removed by setting parameter rds_sql_tracer_reserve_big_records for RDS for MySQL kernel versions 5.7.33.3 or later. RDS for MySQL 5.6 and 8.0 do not support this parameter. You can set the parameter to ON by referring to Modifying RDS for MySQL Instance Parameters, which means that SQL data records containing more than 4,096 bytes are stilled recorded.
- Currently, SQL Explorer takes a period of time to consume and parse raw data. Data of TOP SQL and SQL Insights tasks has a latency of about 5 minutes.
- Logs of all SQL statements executed on free instances can be retained for only one hour while those for paid instances can be retained for seven days by default and for up to 30 days as a maximum. After the retention period expires, the logs are deleted.
- This function is supported only in DAS 5.6.51.1 and later, 5.7.29.2 and later, and 8.0.20.3 and later versions.
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 > SQL Insights.
Toggle on on the right of Collect All SQL Statements.
You can also click Log Settings in the upper right corner of the page to enable Collect All SQL Statements.
Figure 2 Configuring log settings
Collect All SQL Statements takes effect once it is enabled.
If you want to disable Collect All SQL Statements, click Log Settings in the upper right corner and toggle off the switch.
- Click Create Task. In the displayed dialog box, specify Time Range, Dimension, and other configuration items and click OK.
Figure 3 Creating a task
- In the task list, view the task you created.
Figure 4 Viewing a task
- Locate the row containing your task and click Details in the Operation column to view task details.
- Locate your task and click View Syn Tasks in the Operation column to view synchronization task details.
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