Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Do triggers cause a context switch between SQL & PL/SQL
I have always been puzzled by the expression "context switch" when talking about sql and pl/sql.
To me, a context switch is something that happens at the O/S level when a process is suspended by the scheduler and a different process is resumed. If a trigger fires on an insert/update/delete, this is obviously not happening - the only process executing is your Oracle server (dedicated or MTS) - so what activity is being given the name "context switch" ? Surely the Oracle process is 'simply' calling a sub-routine somewhere else in its code path (and building a stack and acquiring sub-heaps and ...).
Regards
Jonathan Lewis
http://www.jlcomp.demon.co.uk
The educated person is not the person
who can answer the questions, but the
person who can question the answers -- T. Schick Jr
One-day tutorials:
http://www.jlcomp.demon.co.uk/tutorial.html
____UK_______April 8th ____UK_______April 22nd ____Denmark__May 21-23rd ____USA_(FL)_May 2nd
Three-day seminar:
see http://www.jlcomp.demon.co.uk/seminar.html
____UK_(Manchester)_May ____Estonia___June (provisional) ____USA_(CA, TX)_August
The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html
> Since you the action switches from SQL to PL/SQL to enforce the
trigger,
> it sounds like a context switch to me.
>
> FYI: This can be improved somewhat by adding "and rownum < 2 " into
the
> WHERE clauses of these. There will be noticable improvement when
there
> are many child rows.
>
> Jared
>
>
>
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Jonathan Lewis INET: jonathan_at_jlcomp.demon.co.uk Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Fri Apr 04 2003 - 13:23:38 CST