Decomposition: by Yuhung Chen CS157A Section 2 October 27 2005
Decomposition: by Yuhung Chen CS157A Section 2 October 27 2005
Decomposition: by Yuhung Chen CS157A Section 2 October 27 2005
By Yuhung Chen
CS157A
Section 2
October 27 2005
Undesirable Properties of Bad Design
Definition:
Let { R1, R2 } be a decomposition of R
R1 = (AB), R2 = (BC)
R1∩ R2 = B, R1 - R2 = A , R2 - R1= C
check B -> A in F ? NO
check B -> C in F ? NO
So, this is lossy join.
Another example
R = (City, Street, Zip) F = {CS -> Z, Z -> C}
R1 = (CZ) R2 = (SZ)
R1 ∩ R2 = Z , R1 – R2 = (SZ)
check Z -> C in F ? Yes
Dependency preserving.
BCNF Decomposition:
Lossless.
4NF Decomposition:
Lossless.
Not necessarily are all 4NF, and thus BCNF and 3NF.
A B C D E
ABC a1 a2 a3 b14 b15
AD a1 b22 b23 a4 b25
BDE b21 a2 b33 a4 a5
Lossless Check Example
Lossless Check Example
Conclusion
Decompositions should always be lossless.
Decompositions should be dependency
preserving whenever possible.
We have to perform the normal
decomposition to make sure we get rid of
the minimal redundant information.
Reference
http://www.cs.hmc.edu/courses/2004/spring/cs133/de
comp.6.pdf
http://www.cs.sfu.ca/CC/354/zaiane/material/notes/C
hapter7/node8.html
http://clem.mscd.edu/~tuckerp/CSI3310/C15.1.html
http://wwwis.win.tue.nl/~aaerts/2M400/pdf/ColNotes7.
pdf