1. Gyanastra
  2. Database Systems
  3. Decomposition
  4. Lossy Decomposition Example with Cross Product
Free lesson, no account needed 5 min read 2 practice questions after it
Asked in past papers1 time
  • UGC NET2016

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.
Figure. R1 and R2 share no attribute, so recombination is a cross product. It produces four tuples instead of three; the extra A2 B2 C2 is spurious, making the decomposition lossy.

How it works

  1. Split a relation into two tables, one containing only attribute A and the other containing attributes B and C.
  2. 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).
  3. Every A-value is paired with every (B, C) combination.
  4. 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):

ABC
A1B1C1
A2B1C1
A1B2C2

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:

BC
B1C1
B2C2

Since R1 and R2 have no common attribute, R1(A) × R2(B, C) produces:

ABCStatus
A1B1C1original tuple
A1B2C2original tuple
A2B1C1original tuple
A2B2C2spurious / 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

CaseHow tables combineResult
Decomposed tables have no common attributeCross product / Cartesian productEvery row of one table pairs with every row of the other; spurious tuples may appear
Decomposed tables have one or more common attributesRows 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.
Pages 1–2 of 2