Considerations for RI constraints in Db2

Important: IBM Cloud Pak for Data Version 4.8 will reach end of support (EOS) on 31 July, 2025. For more information, see the Discontinuance of service announcement for IBM Cloud Pak for Data Version 4.X.

Upgrade to IBM Software Hub Version 5.1 before IBM Cloud Pak for Data Version 4.8 reaches end of support. For more information, see Upgrading from IBM Cloud Pak for Data Version 4.8 to IBM Software Hub Version 5.1.

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.