BCNF and Lossless Join Algorithms




CS157a

Chris Pollett

Sep 25, 2019

Outline

Introduction

Decomposition into BCNF

Example

Algorithm for BCNF Decomposition

In the below, we slightly abuse notation by identifying in places a relation with its set of attributes.

Input. A relation `R_0` with a set of FDs `S_0`.

Output. A decomposition of `R_0` into a collection of relations, all of which are in BCNF.

Method. The following steps are applied recursively to any relation `R` and set of FDs `S`. Initially, set `R = R_0`, `S= S_0`.

  1. Check whether `R` is in BCNF. If so, nothing more needs to be done. Return `{R}` as the answer.
  2. If there are BCNF violations, let one be `X -> Y` . Compute `X^+` using our algorithm from last Wednesday. Choose `R_1 = X^+` as one relation schema and let `R_2`. have attributes `X` and those attributes of `R` that are not in `X^+`. I.e., `R_2` has attributes `(X \cup (R-X^+))`.
  3. Use the algorithm from Monday to compute the sets of FD's for `R_1` and `R_2` ; let these be `S_1` and `S_2`, respectively.
  4. Recursively decompose `R_1` and `R_2` using this algorithm. Return the union of the results of these decompositions.

In-Class Exercise

More on "Good" Relation Schemas

The Importance of Joins

Chase Test for Lossless Join - Making a Tableaux

Chase Test for Lossless Join - Performing a Chase