Snowflake Schema

Context: FIT3003_MOC · a Star Schema in which at least one dimension is broken into two or more tables · the two ways this happens are Dimension Hierarchies and Bridge Tables

Quick Revision

  • 🎯 Objective: recognise that snowflaking is one dimension decomposed into a chain, then say which of the two families it is ➔ hierarchy (a design choice) or bridge (a design necessity).
  • ⚡ Key Constraint: the default is still every dimension linked directly to the fact; a snowflake needs a reason, and “the tables would be in 3NF” is not one.

📝 Core

  • Definition ➔ is broken down into ; only still touches the fact. The other dimensions are one or more hops away.
  • Family 1 — hierarchy ➔ every table in the chain is a dimension with descriptive attributes; each link is many-1 ().
  • Family 2 — bridge table ➔ the middle table is a key pair only, resolving a many-many between the two dimensions it sits between; cardinality reads 1-many then many-1.
  • Why the middle matters ➔ a bridge is forced by the operational E/R schema (the relationship is m–m ➔ Associative Entity); a hierarchy is optional and can always be flattened back into one dimension.
  • Cost of snowflaking ➔ more tables ⟹ more joins per query; the fact-to-leaf path is no longer one hop, so OLAP loses the star’s bounded join count.
  • 3NF is a side effect, not a benefit ➔ a flat carrying sits in 2NF; splitting it reaches 3NF, but the warehouse never pays the update-anomaly cost that 3NF buys off ➔ Star Schema.

🗂️ Schema

erDiagram
  DIM1 ||--o{ FACT : qualifies
  DIM2 ||--o{ FACT : qualifies
  DIM4A ||--o{ FACT : qualifies
  DIM4B ||--o{ DIM4A : "hierarchy: many-1"
  BRIDGE }o--|| DIM4A : "bridge: many-1"
  BRIDGE }o--|| DIM4C : "bridge: many-1"
  FACT {
    KEY dim1_id FK
    KEY dim2_id FK
    KEY dim4a_id FK
    NUMBER measure
  }
  DIM4A {
    KEY dim4a_id PK
    VARCHAR2 attribute
    KEY dim4b_id FK
  }
  DIM4B {
    KEY dim4b_id PK
    VARCHAR2 attribute
  }
  BRIDGE {
    KEY dim4a_id PK
    KEY dim4c_id PK
  }
  DIM4C {
    KEY dim4c_id PK
    VARCHAR2 attribute
  }

(the hierarchy leg and the bridge leg are drawn together for contrast — a real schema carries whichever one its case study forces)

⚖️ Hierarchy Snowflake vs Bridge Snowflake

AspectHierarchy snowflakeBridge snowflake
What the middle table isa full dimension with attributesa key pair only, no descriptive columns
Source cardinalitymany-1 all the way downmany-many between the two dimensions
Optional?yes — flatten into one dimension insteadno — the fact cannot hold the far key at all
What it buys3NF dimensions, nothing analyticalmakes an otherwise unanswerable question answerable
ChapterCh4 ➔ Dimension HierarchiesCh5 ➔ Bridge Tables

When It Flips: a hierarchy is worth drawing only when the child dimension is genuinely a different subject the analyst asks about on its own; a bridge is mandatory the moment the operational E/R shows an m–m between the fact's owner entity and the dimension entity.

⚠️ Common Mistakes

  • 💡 Snowflaking to “normalise the warehouse” ➔ 3NF is the operational discipline; the warehouse trades redundancy for join count on purpose.
  • 💡 Calling any multi-table dimension a hierarchy ➔ if the middle table holds only two keys it is a bridge, and the relationship it resolves is m–m, not many-1.

🧠 Active Recall