This topic describes how to view SQL statement details in OceanBase Cloud Platform (OCP), including the execution status, execution plan, bound indexes, and whether throttling is enabled.
Prerequisites
For a tenant in MySQL mode, the password box of the OCP user must contain the password of the tenant.
For a tenant in Oracle mode, the password box of the OCP user must contain the password of the SYS tenant in the cluster.
Note
To bind indexes and configure throttling, the logged-on tenant in the OCP console must have the tenant update permission.
Go to the SQL statement details page
In the left-side navigation pane, click Tenants and click a tenant in the Tenants list to go to the Overview page of the tenant.
In the left-side navigation pane, click SQL Diagnosis . The SQL Diagnosis page appears.
Find the target SQL statement on the Suspected SQL , TopSQL , or SlowSQL tab.
You can specify conditions to help search for the target SQL statement.

Click the text of the target SQL statement to go to the details page.

On the SQL Details page, you can view the following SQL statement details:
In the SQL Text section, you can view the text of the SQL statement.
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 plan 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.
You can view the binding records of the SQL statement in section ① as illustrated on the Execution Plans , Index , and SQL Throttling tabs.
In a binding record, you can view the status of the bound execution plan, click Unbind to unbind the plan from the SQL statement, and click Bind Plan to bind the plan to the SQL statement again.
View the historical trends of an SQL statement
On the SQL Details page, click the Previous Tendency tab.
You can view the SQL Statement Execution and SQL Plan Generation Time charts on this tab page. When you modify the statistical time in section ① of the figure, both of the charts will be updated based on the new time.
The SQL Statement Execution chart
By default, this chart displays Average Response Time , CPU Time , and Execution Time . You can select more metrics to display in section ② of the figure.

The SQL Plan Generation Time chart
This chart indicates that a new plan is generated. The time used to generate the plan is represented by the y-axis.

View the execution plan of an SQL statement
On the SQL Details page, click the Execution Plans tab. On this tab, you can perform the following operations:
Set the range and time window for query in section ①.
Click the button in section ② to view the execution plan binding records of the SQL statement in the last 30 days.
Click the value in section ③ to view the details of the execution plan, including basic information, execution steps, and execution records on different OBServers.
Click Bind to bind the execution plan to the SQL statement.

View and bind indexes
On the SQL Details page, click the Index tab. On this tab, you can perform the following operations:
View the list of indexes bound to the SQL statement.
You can filter the indexes by indexing status and type. You can also click Bind to bind the SQL statement to an index. You can create indexes in OBClient or OceanBase Developer Center (ODC).
Click View Binding Records in Last 30 Days to view the index binding records of the SQL statement in the last 30 days.
In a binding record, you can view the status of the bound index, click Unbind to unbind the index from the SQL statement, and click Bind Plan to bind the index to the SQL statement again.
Set throttling for an SQL statement
On the SQL Details page, click the SQL Throttling tab. On this tab, you can perform the following operations:
Check whether the current SQL statement is throttled.
The following figure shows that the SQL statement is not throttled.

Set throttling for the current SQL statement.

As shown in the preceding figure, enable throttling and specify the throttling strategy.
Maximum Concurrency: The value range is [0,+∞), and 0 indicates that throttling is disabled.
Throttling Keywords: Click Settings . In the Set Throttling Keywords dialog box, specify the throttling keywords in section ① in the figure.
Note
If no keywords are specified, the entire set of SQL statements are throttled.
- If the throttling keywords failed to be specified, you can view the causes in section ② in the figure.

Click Update , and then click OK in the dialog box that appears.