Note
This variable is available starting with V4.2.3 BP1.
Description
plsql_optimize_level specifies the optimization level when PL/SQL code is compiled.
Privilege requirements
Query variables
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (Oracle mode) or theinformation_schema.SESSION_VARIABLESview (MySQL mode) to view the values of session system variables.Modify variables
The
systenant and all user tenants can directly modify the values of session system variables in their own tenants.
Description
| Attribute | Description |
|---|---|
| Parameter type | Int |
| Default value | 2 |
| Value range | [0,3]
|
| Scope |
|
| Modifiable | Yes. You can execute the SET or ALTER SYSTEM SET statement to modify the value. |
Considerations
A higher optimization level means that the compiler performs more optimization operations. We recommend that you set plsql_optimize_level to 2.
Examples
MySQL mode
Set the PL optimization level to
1globally to disable frontend optimization and enable backend optimization.obclient> SET GLOBAL plsql_optimize_level = 1;Set the PL optimization level to
2globally to enable frontend and backend optimizations.obclient> SET GLOBAL plsql_optimize_level = 2;
Oracle mode
Set the PL optimization level to
1globally to disable frontend optimization and enable backend optimization.obclient> ALTER SYSTEM SET plsql_optimize_level = 1;Set the PL optimization level to
2globally to enable frontend and backend optimizations.obclient> ALTER SYSTEM SET plsql_optimize_level = 2;