Updated on 2026-03-27 GMT+08:00

Creating a SQL Insights Task

Scenarios

SQL Insights allows you to query all executed SQL statements, analyze and search for the tables that are accessed and updated most frequently, and identify SQL statements that have the longest lock wait, helping you quickly locate exceptions.

Constraints

  • You need to enable Collect All Query Logs before using SQL Insights. Collecting all query logs will reduce instance performance by up to 5%.
  • After Collect All Query Logs 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.
  • If the length of a SQL statement exceeds the value of rds_sql_tracer_max_record_size, the statement is not recorded by default.

    To configure the parameter value, see Modifying Parameters of a DB Instance.

  • After Collect All Query Logs is enabled, the SQL text following FROM in prepared statements is omitted (the statements are displayed as PREPARE xxx FROM ...).

Procedure

  1. Log in to the TaurusDB console.
  2. Click in the upper left corner and select a region and project.
  3. On the Instances page, click the instance name.
  4. In the navigation pane, choose DBA Assistant > Historical Diagnosis.
  5. Click SQL Explorer and then SQL Insights.

    Click next to Collect All Query Logs.

    To disable this function, click Log Settings in the upper right corner, toggle off the Collect All Query Logs switch, and click OK.

  6. Click Create Task.

    Figure 1 Creating a SQL insights task

  7. On the displayed page, set Time Range, Synchronization to Other Instances, Dimension, Username, Keyword, Database, Thread ID, SQL Type, and Status.

    You can set Dimension to Instance or Node. When Node is selected, you can view the SQL logs of deleted nodes.

    Figure 2 Creating a SQL insights task

  8. Click OK.
  9. In the task list, view the SQL Insights task.

    • You can click Details in the Operation column to view the SQL Insights task details.
    • You can click View Sync Tasks in the Operation column to view synchronization task details.
    • You can select a keyword such as Time Range, Username, Keyword, or Database to search for the SQL statements executed on the current instance or node.
    Figure 3 Viewing a SQL Insights task