Home » SQL & PL/SQL » SQL & PL/SQL » performance in Context switch
icon5.gif  performance in Context switch [message #310783] Wed, 02 April 2008 07:21 Go to next message
suksar
Messages: 9
Registered: February 2008
Junior Member
Can any one please explain if I call a packge from a different package , will context switch happen ?

And will be the performance impact if the call to another package happens frequently??
If yes, then how???
Re: performance in Context switch [message #310793 is a reply to message #310783] Wed, 02 April 2008 07:41 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
There is no context switch.

Regards
Michel
Re: performance in Context switch [message #311052 is a reply to message #310793] Thu, 03 April 2008 05:24 Go to previous messageGo to next message
suksar
Messages: 9
Registered: February 2008
Junior Member
Thanks Michael,

Can you please explain the reason why their is no context switch?
Re: performance in Context switch [message #311059 is a reply to message #311052] Thu, 03 April 2008 05:34 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Because there is no need to switch something.

Regards
Michel
Re: performance in Context switch [message #311060 is a reply to message #311052] Thu, 03 April 2008 05:35 Go to previous messageGo to next message
rajatratewal
Messages: 507
Registered: March 2008
Location: INDIA
Senior Member
A performance issue arises from the fact that there are two engines in the database, the PL/SQL engine and the SQL engine. In some versions of the database, these engines actually have different capabilities resulting in some features being available in SQL but not in PL/SQL. When a cursor fetches a row of data it performs a “context switch” to the SQL engine, and it is the SQL component that retrieves the data. The SQL engine places the data in-memory and another context switch places us back into the PL/SQL engine.

The PL/SQL engine then continues processing until the next row is required, and the process repeats. A context switch is very fast, but if performed over and over again, the constant switching can take a noticeable amount of time.
Re: performance in Context switch [message #311062 is a reply to message #311060] Thu, 03 April 2008 05:39 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This is not the question.
There is no context switch when you call a procedure in another package.
SQL engine is irrelevant here.

Regards
Michel
icon10.gif  Re: performance in Context switch [message #311065 is a reply to message #311062] Thu, 03 April 2008 05:43 Go to previous messageGo to next message
rajatratewal
Messages: 507
Registered: March 2008
Location: INDIA
Senior Member
Dear Michel,

That's what i am trying to show that Context Switch means Switching Between PL/SQL engine and SQL Engine.

Please correct me if i am wrong. Grin

Regards,
Rajat Ratewal
Re: performance in Context switch [message #311068 is a reply to message #310793] Thu, 03 April 2008 05:48 Go to previous message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
Michel Cadot wrote on Wed, 02 April 2008 13:41
There is no context switch.

Regards
Michel


There is if a procedure in the other package execute a SQL statement.
Edit: More accurately, There would be a context switch if the calling subprogram calls a subprogram that then subsequently executes a SQL statement.

[Updated on: Thu, 03 April 2008 05:50]

Report message to a moderator

Previous Topic: commit the records
Next Topic: Getting Columns Selected Via A Query Dynamically
Goto Forum:
  


Current Time: Sat Dec 03 16:02:34 CST 2016

Total time taken to generate the page: 0.09984 seconds