what is Context Switching in Oracle while executing Stored Programs.
Oracle use two engine for execution of PL/SQL programs :
1. PL/SQL Engine
2. SQL Engine
During execution of Pl/Sql Program to execute all procedural statements (like if, for, assignments...) Oracle use Pl/Sql engine and sends all SQL statements present in the code to the SQL engine. The SQL engine will parse and execute the query or DML statement and return the expected output back to the PL/SQL engine. This switch between the two engines is called context switching.
Which impose additional overhead like maintain the state of variables and stack on every switch..... means highly expensive. Specially the cursor loops are very expensive so instead of that one should use Bulk Bind and Bulk collect features which reduce context switching.
1. PL/SQL Engine
2. SQL Engine
During execution of Pl/Sql Program to execute all procedural statements (like if, for, assignments...) Oracle use Pl/Sql engine and sends all SQL statements present in the code to the SQL engine. The SQL engine will parse and execute the query or DML statement and return the expected output back to the PL/SQL engine. This switch between the two engines is called context switching.
Which impose additional overhead like maintain the state of variables and stack on every switch..... means highly expensive. Specially the cursor loops are very expensive so instead of that one should use Bulk Bind and Bulk collect features which reduce context switching.
4 Comments:
At 23 June 2011 at 22:04 , salim said...
Very nice Sir,'
This block regarding context switching is very helpful.
Hope you keep on posting such articles,'''
Thanks
At 2 March 2015 at 17:38 , Anonymous said...
Good one
At 2 January 2016 at 16:09 , XYZ said...
This comment has been removed by the author.
At 2 January 2016 at 16:10 , piyu said...
thank u
Post a Comment
Subscribe to Post Comments [Atom]
<< Home