PL code in OceanBase Database supports only compiled execution. This topic describes the execution mechanism between the PL engine, OBServer, and SQL engine.
Compiled execution has better performance advantages than interpreted execution, especially when the PL engine has many internal computing elements.
In the compiled execution framework, PL source code is directly compiled into executable code for the corresponding platform. When the PL engine executes, OBServer directly invokes the compiled executable code. The compiled PL code is cached in the PL cache, so the same PL code needs to be compiled only once.

PL code is stored in OBServer when it is defined. When an application calls a stored procedure, OBServer first reads the PL code definition from the data dictionary, compiles the PL code definition into executable binary code, and stores the compiled PL binary code in the PL cache. During execution, the PL engine obtains the executable code from the PL cache and works with the SQL engine to complete the execution of the PL code.
Stored procedures can be nested. For example, the current PL block can call another stored procedure.