/
United States
- New york city, New york, USA
- Los angeles, California, USA
- Chicago, Illinois, USA
- Boston, Massachusetts, USA
- San francisco, California, USA
Oracle triggers if updating performance
If your trigger performs tests to see what needs to be done (i.e.
needs to treat updated rows differently to newly inserted ones) then there could be an impact if query plans that are sub-optimal for common cases get cached and reused for those cases.
Obviously, not all of these tests will be valid for a single trigger, but one of the principles of testing is to test events that shouldnt cause a response.Also from a perspective of performance it will be better to have them isolated?From a performance point of view if the are doing the same thing then there will be no difference.Once the trigger is up and running, we don’t have to worry about updating that column anymore.Without the trigger, every developer must remember to update that column in every new code that updates the table.Since you can't list more than one table in the Oracle UPDATE statement, you can use the Oracle EXISTS clause.It is a good practice to have a separate trigger for After Insert and another one for After Update or there is no problem in having both in the same logic?