Note
This variable was introduced in V4.2.3 BP1.
The plsql_optimize_level variable controls the optimization level during compilation of PL code.
Privilege requirements
Query variables
Users in the
systenant and all users in user tenants can view the values of session system variables by using theSHOW VARIABLESstatement or theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (Oracle mode) and theinformation_schema.SESSION_VARIABLESview (MySQL mode).Modify variables
Users in the
systenant and all users in user tenants can directly modify the values of session system variables in their own tenant.
Feature description
| Attribute | Description |
|---|---|
| Parameter type | Int |
| Default value | 2 |
| Value range | [0,3]
|
| Scopes |
|
| Modifiable | Yes. It can be modified by using the SET statement. |
Suggestions
Higher optimization levels mean more optimizations are performed by the compiler. We recommend that you set the plsql_optimize_level variable to 2. If you want more information, see Examples.
Examples
MySQL mode
Set the PL optimization level to
1at the global level to disable frontend optimization and enable backend optimization.obclient> SET GLOBAL plsql_optimize_level = 1;Set the PL optimization level to
2at the global level to enable frontend and backend optimization.obclient> SET GLOBAL plsql_optimize_level = 2;
Oracle mode
Set the PL optimization level to
1at the global level to disable frontend optimization and enable backend optimization.obclient> ALTER SYSTEM SET plsql_optimize_level = 1;Set the PL optimization level to
2at the global level to enable frontend and backend optimization.obclient> ALTER SYSTEM SET plsql_optimize_level = 2;