The New SQL refers to the SQL that have not been executed for a period of time (7 days by default) before the query interval, but have execution records within the query interval.This topic describes how to view cluster SQL diagnostics information.
Procedure
Log on to the OceanBase Cloud Platform (OCP) console.
In the left-side navigation pane, click Autonomous service.
In the Cluster Details section, click the name of the target cluster.
By default, the SQL Diagnostics tab of the Real-time Diagnostics page appears.
Click the New SQL tab.
Specify the filter conditions, filter the New SQL statements.
Time Range: You can select Last 5 Minutes, Last 10 Minutes, Last 20 Minutes, Last 30 Minutes, Last 1 Hour, or Last 3 Hours from the Time Range drop-down list. You can also select Custom Time from the drop-down list and specify the start time and end time as needed. By default, the information of the last 30 minutes is displayed.
Internal SQL: If you select this option, the SQL statements internally initiated in OceanBase Database are displayed in the query result.
Keyword: The SQL statements that contain the specified keyword are displayed in the query result.
Advanced Search: You can add multiple filter conditions in Advanced Search . Click Add . In the Add Advanced Condition dialog box, you can specify a metric, an operator, and a metric value. The SQL statements that match the specified criteria will be displayed in the query result.
Click Search to list all SQL statements that meet the search criteria. You can perform the following operations on the query results:

Click Export TopSQL to export all the SQL statements in the query result.
Click Custom Column . In the dialog box that appears, specify the expression and name for the custom column. Then, you can view the column in the New SQL list.
View New SQL information. You can click the SQL text of an SQL statement to go to the SQL Details page of the statement. On the SQL Details page, you can view the following details of the SQL statement:
In the SQL Text section, you can view the complete SQL statement.
In the Optimization Suggestions section, you can view the SQL Statement Execution and SQL Plan Generation Time for the SQL statement. For more information, see View optimization suggestions.
On the Previous Tendency tab, you can view the historical trends of the SQL statement. For more information, see View the historical trends of an SQL statement.
On the Execution Plans tab, you can view the execution plans of the SQL statement, or bind an execution plan to the statement. For more information, see View the execution plans of an SQL statement.
On the Index tab, you can view the indexes bound to the SQL statement. For more information, see View and bind indexes.
On the SQL Throttling tab, you can view or set throttling of the SQL statement. For more information, see Set SQL throttling.