Triggers

If an INSERT, UPDATE, or DELETE command is slow, check whether the table has any triggers. Either use a GUI tool like TOAD or the SQL below:

You may also query user_triggers if you own the table you are inspecting. Be wary of GUI tools and the all_triggers view (GUI tools may be using the all_triggers view), even if you have privileges on a table, you may not be able to see the triggers in all_triggers if you are connected as user which has only SELECT privs.

If a table does have a trigger, run the INSERT, UPDATE, or DELETE through SQL Trace to see why it is so slow. You will probably need to tune the trigger instead of the INSERT statement.

If you are doing thousands of INSERTs, UPDATEs, or DELETEs, then triggers might not be the best way to handle whatever it is they are doing. Perhaps the whole thing could be packaged up into a high volume PL/SQL routine.


©Copyright 2003