Decomposition and Schema Normalization Flashcards
What should good decomposition achieve?
minimize redundancy, avoid information loss (lossless-join), preserve the FDs (dependency preserving), ensure good query performance
Lossless join
If for any initial instance R,
the decomposed instance R’ = R
A decomposition is lossless-join iff at least one of the FDs in in F+
A1 ^ A2 -> A1
A1 ^ A2 -> A2
A decomposition is dependency preserving if
by enforcing FD F1 over R1 and FD F2 over R2, we can enforce F over R
Boyce Codd Normal Form (BCNF)
A relation is in BCNF if whenever X -> B is a non-trivial FD, then X is a superkey in R
BCNF other definition
For ever attribute set X:
either X+ = X
or X+ = all attributes
BCNF Decomposition Properties
BCNF decompostion:
- removes certain types of redundancy
- is a lossless join
- is not always dependency preserving
3NF Definition
whenever X -> A, one of the following is true:
A in X (trivial FD)
X is a superkey
A is part of some key of R (prime attribute)
3NF Characteristics
Lossless join and dependency preserving decomposition into a collection of 3NF relations is always possible.
3NF Algorithm
Apply the algorithm for BCNF decomposition until all relations are in 3NF
compute a minimal basis F’ of F
For each non-preserved FD X-> A in F’, add a new relation R(X,A)
Is normalization always good?
No, suppose A and B are always used together, but normalization says they should be in diff talbes > performance loss