BCNF and Lossless Join Algorithms




CS157a

Chris Pollett

Sep 26, 2018

Outline

Introduction

Decomposition into BCNF

Example

Algorithm for BCNF Decomposition

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^+`.
  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