Note
This variable was introduced in V4.2.3 BP1.
The plsql_optimize_level variable controls the optimization level for PL code compilation.
Privilege requirements
Query variables
Tenants of the
systenant and user tenants can query the session system variable's value by using theSHOW VARIABLESstatement or theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (Oracle mode) or theinformation_schema.SESSION_VARIABLESview (MySQL mode).Modify variables
Tenants of the
systenant and user tenants can directly modify the session system variable's value in their own tenant.
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;
