I recently read your
and I have a question.
TableA is a high transaction table. TableB is essentially a copy of TableA with indexes for reporting. I want to create an insert/update trigger on TableA to replicate the change to TableB.
I?m worried about performance. Mainly, will TableA be locked up until the commit on TableB completes? Or, will DB2 spawn another process to handle TableB?
Maybe you could also direct me to information on this problem? Thank you very much for your time.
The triggered action becomes part of the unit of work of the SQL statement that triggered the action. So, in your case, the process required to replicate the change to TableB will be part of the UOW that initially makes the change to TableA. In an environment with high transaction rates this scenario is not likely to perform very well for you.
How much of a delay can you incur between the change happening to TableA and it being replicated to TableB? If there can be a delay then I would recommend that you look into getting some type of replication or ETL tool so you can set up an asynchronous process having the modification to TableB get queued and then made in the background so that it does not impact the performance of the transactions changing TableA.
Here are some online resources for further reading:
Object-Relational Programming with DB2
Are you Trigger Happy?
Fun with Triggers
Replication Guide and Reference
Editor's note: Do you agree with this expert's response? If you have more to share, post it in one of our
Dig Deeper on IBM DB2 management
Our expert suggests that the best way to pass the SAP BW exam is to have hands-on job experience. But that's not all he has to say about ...
To export data from a DB2 table to a flat file, you need to run an export specifying the proper file format. The export utility exports data from a ...
Craig Mullins recommends two specific resources for learning how to create and support Binary Large Objects (BLOB) in DB2.
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.