Considerations for RI constraints
When your tables have referential integrity (RI) constraints, include parent, child, and any other related tables in the same replication set. When adding tables to a replication set, add parent tables first and then the child tables.
Very complex RI dependencies affect the database performance and the maximum level of parallelism that the apply program can achieve. Replication supports RI constraints on replicated objects, but the constraints affect Db2® and replication performance. For improved performance, avoid overly complex constraints when possible.
Follow these tips to improve replication performance with referential integrity constraints:
- For fallback after a prolonged outage, drop RI constraints at the site that is being brought back online for faster resynchronization. Restore the RI constraints before rerouting applications to that site.
- Use the igncasdel parameter to instruct the capture program not to replicate delete operations that result from the delete of parent rows (cascading deletes). This method gives better performance because fewer changes are propagated.