Note
This variable is available starting with V4.2.3 BP1.
plsql_optimize_level specifies the optimization level for compiling PL/SQL code.
Privilege requirements
Query variables
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (Oracle-compatible mode) or theinformation_schema.SESSION_VARIABLESview (MySQL-compatible 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 for their own tenants.
Description
| Attribute | Description |
|---|---|
| Type | Int |
| Default value | 0
This variable is available starting with V4.4.1, and the default value is 0. |
| Value range | [0,3]
|
| Scope |
|
| Modifiable | Yes. You can execute the SET or ALTER SYSTEM SET statement to modify the value. |
Usage notes
The higher the optimization level, the more optimization operations the compiler performs. We recommend that you set plsql_optimize_level to 2.
Examples
MySQL-compatible 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 optimization.obclient> SET GLOBAL plsql_optimize_level = 2;
Oracle-compatible 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 optimization.obclient> ALTER SYSTEM SET plsql_optimize_level = 2;