Observation: Cascading DELETE

A DELETE which invokes a CASCADE constraint might cause performance problems on large tables, especially if DB2 propagates the DELETE to several tables. To improve DELETE performance, consider the following:

  • Ensure indexes exist on the foreign keys. Without an index, deleting a row from the parent table requires a scan of each dependent table for which an index does not exist.

  • If rows in the parent table are frequently deleted and there are indexes defined for the foreign keys, place dependent tables to which deletes are cascaded into the same tablespace.