The PL/SQL engine is a virtual
machine that resides in memory and processes the PL/SQL m-code instructions.
When the PL/SQL engine encounters an SQL statement, a context switch is made to
pass the SQL statement to the Oracle server processes. The PL/SQL engine waits
for the SQL statement to complete and for the results to be returned before it
continues to process subsequent statements in the PL/SQL block.
In other words, context switching in Oracle databases refers to the overhead incurred when control shifts between the SQL engine and the PL/SQL engine during the execution of mixed SQL and PL/SQL code. The two engines operate in different runtime environments, so when you run SQL statements within PL/SQL code, the database has to 'switch' between these environments. This switching can cause performance degradation.
Automatic PL/SQL to SQL Transpiler
PL/SQL functions within SQL statements are automatically converted (transpiled) into SQL expressions whenever possible.