Database Systems · Decomposition
Lossy Decomposition Example with Cross Product
Overview
A decomposition splits one relation into two or more smaller relations. When the smaller relations share no common attribute, they can only be recombined by a Cartesian product, which can create tuples that never existed in the original relation — making the decomposition lossy.
Key concepts
- Decomposition: splitting one relation into two or more smaller relations.
- No common attribute: if the smaller relations share no attribute, there is no equality condition for a natural join, so recombination behaves as a Cartesian product (cross product).
- Cartesian product: pairs every row of one table with every row of the other table.
- Lossy decomposition: a decomposition whose recombination produces new (spurious) tuples that were not present in the original relation.
- Corrective rule: decomposed tables should have at least one attribute in common so they can be combined correctly later.
- Choice of common attribute: the common attribute should not be chosen randomly; an arbitrary common attribute may still fail to reconstruct the original relation.
Drawing the diagram…
How it works
- Split a relation into two tables, one containing only attribute A and the other containing attributes B and C.
- The two tables have no common attribute, so a natural join has no equality condition to match rows and behaves as a cross product: R1(A) × R2(B, C).
- Every A-value is paired with every (B, C) combination.
- Some resulting tuples were not in the original relation; these spurious tuples make the decomposition lossy.
Formulas
- R1(A) × R2(B, C) — cross product of the two decomposed relations when they share no attribute; pairs every row of R1 with every row of R2.
Worked examples
Original relation R(A, B, C):
| A | B | C |
|---|---|---|
| A1 | B1 | C1 |
| A2 | B1 | C1 |
| A1 | B2 | C2 |
Decomposition:
- R1(A) = projection of R on A
- R2(B, C) = projection of R on B and C
Projection on A:
| A |
|---|
| A1 |
| A2 |
Projection on B, C:
| B | C |
|---|---|
| B1 | C1 |
| B2 | C2 |
Since R1 and R2 have no common attribute, R1(A) × R2(B, C) produces:
| A | B | C | Status |
|---|---|---|---|
| A1 | B1 | C1 | original tuple |
| A1 | B2 | C2 | original tuple |
| A2 | B1 | C1 | original tuple |
| A2 | B2 | C2 | spurious / extra tuple |
The recombined relation has 4 tuples while the original had 3 tuples. The extra tuple is A2, B2, C2, so the decomposition is lossy.
Comparison
| Case | How tables combine | Result |
|---|---|---|
| Decomposed tables have no common attribute | Cross product / Cartesian product | Every row of one table pairs with every row of the other; spurious tuples may appear |
| Decomposed tables have one or more common attributes | Rows can be matched using the common attribute(s) | Easier to combine and recover the original relation correctly |
Revision summary
- No common attribute between decomposed tables means recombination is a cross product.
- A cross product pairs every row of one table with every row of the other.
- Extra tuples generated on recombination are spurious; their presence makes the decomposition lossy.
- Always keep at least one common attribute between decomposed tables so they can be joined later.
- Do not pick the common attribute randomly — an arbitrary choice may not preserve the original relation.
- In the example, the spurious tuple added is A2, B2, C2 (4 tuples after recombination vs 3 originally).
Previous-year exam insights
- A decomposition of R into R1 and R2 is lossless (non-lossy) if and only if the common attributes of R1 and R2 form a superkey of at least one of them, i.e. (R1 ∩ R2) → R1 or (R1 ∩ R2) → R2 holds under the given FDs; otherwise it is lossy.
Asked inUGC NET 2016 - A decomposition is lossy when the natural join of the decomposed relations produces tuples not present in the original relation (spurious tuples); losslessness is about content preservation, not about absence of redundancy.
Asked inUGC NET 2016 - To test losslessness of a binary decomposition, compute the attribute closure of the intersection of the two relation schemas under the given FDs; if the closure contains all attributes of either R1 or R2, the decomposition is lossless.
Asked inUGC NET 2016 - A decomposition into two relations that share no common attribute is always lossy (unless one of the relations is empty), because the natural join degenerates to a Cartesian product.
- A lossy decomposition can never correctly recover the original relation regardless of the FDs, so lossless join is required of any acceptable decomposition; it is independent of dependency preservation and does not by itself guarantee freedom from redundancy.
- For a decomposition into more than two relations, losslessness is checked by the chase (tableau) test: build a tableau with a row per subrelation and apply the FDs until no change; the decomposition is lossless iff some row becomes all distinguished variables.