This topic describes how to refresh the plan cache.
Background information
After a major compaction is performed on an OceanBase cluster, new SQL execution plans are generated. The variable values passed for the first execution of an SQL statement determine the execution plan that is generated for the statement. If the variable values are not normal values, the generated execution plan is not the optimal one, and the overall performance of SQL execution may be affected.
After the plan cache is refreshed, all existing execution plans are flushed out of the cache, and new execution plans are generated for SQL statements. Therefore, you can refresh the plan cache as an emergency solution to generate optimal execution plans.
After you refresh the plan cache, the system immediately reparses all SQL statements or generates new execution plans. In this case, more CPU resources are consumed, which may cause fluctuations in database performance. Proceed with caution.
Procedure
Log on to the ApsaraDB for OceanBase console.
In the left-side navigation pane, click Clusters.
On the Clusters page, click the name of the required cluster to go to the Cluster Workspace page.
In the tenant list, click the name of the tenant for which you want to refresh the plan cache. The Tenant Details page appears.
Click the More icon in the upper-right corner and select Refresh Plan Cache.
Click OK. This operation may cause fluctuations in database performance. Proceed with caution.