Overview

Testing functional dependency constraints each time the database is updated can be costly. Thus, it is useful to design the database in a way that constraints can be tested efficiently.

When decomposing a relation, it may be no longer possible to do the testing without having to perform a Cartesian product of join operations.

A decomposition that makes it computationally hard to enforce functional dependency is said to be not dependency preserving.

Conversely, if functional dependencies of the original relation can be checked on the decomposed relations without the need of Cartesian product or join operations, is said to be dependency preserving.

Definition

Let be the set of functional dependencies on schema , and let be a decomposition of . Let be a restriction of to .

The decomposition is dependency preserving if the following holds:

Testing for dependency preservation using the above definition takes exponential time.

Algorithm for testing dependency preservation

The following algorithm checks if a dependency is preserved in a decomposition of into .

result = alpha
REPEAT
  FOR EACH R[i] IN D
    t = CLOSURE(result INTERSECT R[i]) INTERSECT R[i]
    result = result UNION t
UNTIL (result CONVERGE)

If result contains all attributes in , then the functional dependency is presereved.

This method takes polynomial time, instead of exponential time required when using the definition directly.