Extraneous attribute

Some attributes in a given relational schema do not affect the closure of functional dependency of the schema.

An attribute of functional dependency in is said to be extraneous if it can be removed without changing its closure .

When removing an attribute from a functional dependency:

  • Removing an attribute from the left side of a functional dependency could make it a stronger constraint.
  • Removing an attribute from the right side of a functional dependency could make it a weaker constraint.

Consider a set of functional dependencies and a functional dependency . Then attribute is extraneous if:

  • :
    logically implies
  • :
    logically implies .

Note that a stronger functional dependency always implies a weaker one.

Testing if an attribute is extraneous

Let be a relation schema, and let be a set of functional dependencies that hold on .

Consider an attribute in the functional dependency .

  • Testing if is extraneous in :
    1. Let .
    2. Compute under .
    3. If , is extraneous in .
  • Testing if is extraneous in :
    1. Let
    2. Compute under .
    3. If , is extraneous in .

Canonical cover

A canonical cover for is a set of dependencies that satisfies all of the followings:

  • logically implies all dependencies in .
  • logically implies all dependencies in .
  • None of the attributes in is extraneous.
  • Each left side of all functional dependencies in is unique.
    • i.e.,

Purpose of canonical covers

Whenever a user performs an update on a relation, the database system must ensure that the update does not violate any functional dependencies.

The effort spent in checking for violations in functional dependencies can be reduced by testing on only a simplified set of functional dependencies that has the same closure as the given set. This is the canonical cover of the functional dependencies.

Algorithm for computing canonical covers

F_c = F
REPEAT
  FOR EACH alpha -> beta1, alpha -> beta2 IN F_c
    APPLY union rule
    /* alpha -> beta1, beta2 */
    REPLACE TO F
  FOR EACH f in F_c
    IF EXISTS (extraneous attribute A) IN f
    REMOVE A FROM f
UNTIL (F_c CONVERGE)

Note that the union rule may become applicable after some extraneous attributes have been deleted, so it has to be re-applied.