CSE Roadmap

Common tier · about 3 hours · 5 parts

Part 4 of 5 · 2 min read

Dependency-preserving decomposition

Making sure every original constraint can still be checked without a join.

Dependency-preserving decomposition

Think of splitting a single rulebook into two smaller ones, but accidentally leaving a rule in neither, so nobody can check it anymore without first fetching both books and cross-referencing them by hand.

In plain words: a decomposition is dependency-preserving if every functional dependency from the original table can still be checked using only the columns within one of the resulting tables, without needing a join. A decomposition that loses this property still works, but makes enforcing an original rule harder, requiring a join or a trigger where a simple constraint used to suffice.

A worked example. Splitting customers (customer_id, postal_code, city) preserves postal_code → city, since it can still be checked entirely within the new postal_codes table alone.

The key lines. No new SQL; checking dependency preservation is a design-time review, not a runtime query.

Dependency-preserving decomposition

A dependency-preserving decomposition keeps every original functional dependency checkable within a single resulting table, without needing a join to verify it.

Example: postal_code → city stays checkable inside postal_codes alone after the split, so this decomposition is dependency-preserving.

Remember this

Every decomposition should be checked for both properties: lossless (the join back must reproduce the original exactly) and dependency-preserving (every rule must stay checkable without a join). A decomposition failing either property has traded one problem for a worse one.

Quick notes

  • A lossless decomposition reproduces the original exactly when the pieces are joined back together.
  • Splitting on a column that is not a key of either piece risks a lossy decomposition, creating phantom rows.
  • A dependency-preserving decomposition keeps every original rule checkable within one resulting table.
  • Losing dependency preservation means a rule now needs a join, or a trigger, to enforce, where a simple constraint used to suffice.
  • Every real decomposition should be checked for both properties before being treated as a genuine fix.