0000
Example 1:
Relation R (ABCDEG) and functional dependencies {AB → C, AC → B, AD → E, B → D, BC → A, E → G}
Decomposition (D) = {AB, BC, ABDE, EG}
Solution:
Let
.png)
Let try a search for the first pair of relation which makes lossless join decomposition.
.png)
.png)
.png)
.png)
.png)
So, it is lossless.
We can join them
.png)
Now we have three relations
{ABDE, BC, EG}
.png)
Check for joining pair
.png)
.png)
.png)
.png)
.png)
Now two relations left {ABDEG, BC}
.png)
.png)
.png)
So, the overall decomposition of R (ABCDEG) is lossy decomposition.
Note: We always check one possible best pair not to check all possible pairs.
Example 2:
Let relation R (ABCDEG) and FDs {AB → C, AC → B, AD → E, B → D, BC → A, E → G}
Decomposition D = {ABC, ACDE, ADG}. Find it is lossy or lossless decomposition.
Solution:
Let
.png)
Looking for the first pair which is lossless
.png)
.png)
.png)
So, it is a lossless join. Take this pair and join them.
.png)
Now two relations left {ABCDE, ADG}
Checking for lossless
.png)
So, it is lossless, join them.
.png)
So, total decomposition is lossless.
Contributed by