impact of heavy updates on triggers
Posted in 1999
Topics: Installation, Setup & Upgrades, Triggers, Constraints & Referential Integrity
Hi, If you setup some triggers to check for insert, update, delete events on a table (intended for rare table changes) and you run a maintenance type program to make lots of inserts or updates etc. (e.g. using a load command or updates from a batch file) can the triggers handle such heavy and fast changes. Basically, I have a trigger that writes timestamps in a special table whenever any of certain list of tables has any modification. 1. Does a trigger handles all events fast enough to keep up with the table changes or it does it mess up and corrupts the data it is supposed to process because of frequent trigger events ? 2. One way is to delete the trigger before running such programs/scripts and reinstall it. But is there a convenient way or option on triggers to simply disable it temporarily and reenable it later ? 3. Any other caveats or any nice Informix features I can use to do it ? Thanks for input. -AH
Atiq Hashmi wrote: > > Hi, > > If you setup some triggers to check for insert, update, delete > events on a table (intended for rare table changes) and you run a > maintenance type program to make lots of inserts or updates etc. > (e.g. using a load command or updates from a batch file) can the > triggers handle such heavy and fast changes. > Basically, I have a trigger that writes timestamps in a special > table whenever any of certain list of tables has any modification. > > 1. Does a trigger handles all events fast enough to keep up with > the table changes or it does it mess up and corrupts the data it is > supposed to process because of frequent trigger events ? Not a problem. Never saw a trigger mess up yet. > 2. One way is to delete the trigger before running such programs/scripts > and reinstall it. But is there a convenient way or option on triggers > to simply disable it temporarily and reenable it later ? You can do that for performance for a really huge bulk load the manually insert a "bulk load" record into the audit table and readd the triggers. > 3. Any other caveats or any nice Informix features I can use to do it No. Art S. Kagel
I think Atiq Hashmi wrote: > > Hi, > > If you setup some triggers to check for insert, update, delete > events on a table (intended for rare table changes) and you run a > maintenance type program to make lots of inserts or updates etc. > (e.g. using a load command or updates from a batch file) can the > triggers handle such heavy and fast changes. > Basically, I have a trigger that writes timestamps in a special > table whenever any of certain list of tables has any modification. > > 1. Does a trigger handles all events fast enough to keep up with > the table changes or it does it mess up and corrupts the data it is > supposed to process because of frequent trigger events ? The frequency of the updates CAN cause a loss of performance, but WILL NOT cause any kind of corruption > 2. One way is to delete the trigger before running such programs/scripts > and reinstall it. But is there a convenient way or option on triggers > to simply disable it temporarily and reenable it later ? Don't know what kind of Informix Engine you use, but if your version is recent enough, you could try out some SET commands in your batch/maintenance, like this: SET CONSTRAINTS, TRIGGERS, INDEXES FOR TABLE <tab_name> {DISABLED|ENABLED} Please refer to your documentation or visit http://www.informix.com/answers for a complete description of this kind of command, and all options available. > 3. Any other caveats or any nice Informix features I can use to do it ? If your batch is a load, try out the High Performance Loader. You will be surprised ;^) > > Thanks for input. > -AH -- _________________________________________________ Paulo Silva mailto:psilva@informix.com Consultant/Trainer phone : +351 1 412 89 40 Informix Software Portugal fax : +351 1 410 84 37