1.8 Types of Decomposition and Dependency Preservation
1.8 Types of Decomposition and Dependency Preservation
Decomposition in DBMS
• The process of decomposition in DBMS helps us remove
redundancy, inconsistencies and anomalies from a
database when we divide the table into numerous tables.
Dependency Preservation
• Let Fi be the set of dependencies
F+ that includes only attributes in
Ri
– A decomposition is dependency
preserving, if (F1 F2 … Fn)+ =
F+
– If it is not, then checking updates for
violation of functional dependencies
may require computing joins, which is
expensive
1
5
Example - Dependency
Preservation
• A Dependency preserving decomposition of a relation R is R1,
R2, R3...Rn concerning the set of Functional Dependencies FD
if,
Example - Dependency
Preservation
• With FD (FD1) R is decomposed or divided into R1 and with
FD(FD2) into R2, then the possibility of three cases arise,
Example - Dependency
Preservation
• Let suppose, a relation R (P, Q, R, S) with a set of Functional
Dependency FD = (PQ→R, R→S, S→P) is given. Into R1 (P, Q, R)
and R2(R, S), relation R (P, Q, R, S) is decomposed. Find out
whether the decomposition is dependency preserving or not.
Solution:
Example - Dependency
Preservation
closure (P) = {P} // Trivial
closure (Q) = {Q} // Trivial
closure (R) = {R, P, S} //but S can't be in closure as S is not
//present in R1 (P, Q, R).
= {R, P}
(R--> P // Removing R from right side as it is trivial
attribute)
closure (PQ) = {P, Q, R, S}
= {P, Q, R}
(PQ --> R // Removing PQ from right side as these are trivial
attributes)
closure (QR) = {Q, R, S, P}
= {P, Q, R}
1
9
Example - Dependency
Preservation
(QR --> P // Removing QR from right side as these are trivial attributes)
Closure (PR) = {P, R, S}
(PR --> S // Removing PR from right side as these are trivial attributes)
FD1 {R --> P, PQ --> R, QR --> P}.
Example - Dependency
Preservation
• From the given result, in FD1, PQ holds R (PQ --> R) and in FD2, R
holds S (R --> S). But, there is no follow up in Functional
Dependency S holds P (S --> P).