Fact Constellation

Context: FIT3003_MOC Β· what a warehouse becomes when dimension hierarchies are materialised as one fact per level βž” Levels of Aggregation, Multi-Fact Star Schemas, Dimension Hierarchies Parent Framework: Levels of Aggregation

Quick Revision

  • 🎯 Objective: granularity, hierarchy and multi-fact are the same phenomenon βž” splitting a hierarchy into one fact per level produces a multi-fact schema whose facts differ only in level of aggregation; a multi-fact, multi-hierarchy schema is a Fact Constellation.
  • πŸ“¦ Core Components: hierarchies of lengths βž” fact tables, all sharing the non-hierarchy dimensions.
  • ⚑ Key Constraint: the levels form a lattice with several paths, not a chain β€” numbering the facts in a line is wrong, because facts from different hierarchies are incomparable.

πŸ“ How It Works

1. Hierarchy βž” multi-fact

  • Start point βž” with a Branch βž” City βž” Country hierarchy hanging off βž” Snowflake Schema.
  • Split the hierarchy βž” one fact per level: , , β€” same measure Total_Sales, different granularity, all sharing and .
  • Hierarchy direction βž” read it from the most detailed (Branch) down to the most general (Country); that direction is the level ordering β€” Branch Level-1, City Level-2, Country Level-3.
  • Rejoining them βž” keep the many-1 links between and let the three facts share the remaining dimensions; that single diagram is the multi-fact star.

2. A second hierarchy multiplies the facts

  • Time hierarchy βž” gives and over the same and .
  • Cross product βž” combining the location hierarchy with the time hierarchy yields fact tables β€” Quarterly/Yearly Branch/City/Country.
  • Name βž” this multi-fact, multi-hierarchy schema is a Fact Constellation.

3. Level numbering follows paths, not a list

  • Two partitions βž” one group of levels based on time, one based on location; a comparison is only valid within a partition or when both coordinates move the same way.
  • Incomparable pair βž” Quarterly Country Sales vs Yearly City Sales β€” coarser in location, finer in time, not formed by one hierarchy, so neither is more general.
  • Comparable pair βž” Yearly Country Sales is unambiguously more general than Quarterly Country Sales (location fixed, time coarsened).
  • Four paths, four levels βž” every path runs from the single most detailed schema (Branch Quarterly) to the single most general (Country Yearly), and within a path the ordering is exact.

πŸ—‚οΈ Schema

πŸ“Š Exam Execution Trace & Applied Exercises

Manual Execution Trace β€” comparing two schemas in the constellation

PairLocation axisTime axisVerdict
Country Yearly vs Country QuarterlyequalcoarserCountry Yearly is more general
Country Yearly vs Branch YearlycoarserequalCountry Yearly is more general
Country Quarterly vs City Yearlycoarserfinernot comparable
Branch Yearly vs City Quarterlyfinercoarsernot comparable
Branch Quarterly vs anythingfinestfineststrictly below everything βž” the bottom of the lattice
  • The rule the table encodes βž” is more general than iff is coarser-or-equal on every axis and strictly coarser on at least one.

⚠️ Common Mistakes

  • πŸ’‘ Treating levels as a total order βž” with two hierarchies the level number is a rank in the lattice, and two schemas can share a rank while being incomparable βž” Levels of Aggregation.
  • πŸ’‘ Duplicating the shared dimensions βž” and are created once and pointed at by all facts; only the hierarchy dimensions differ βž” Multi-Fact Star Schemas.
  • πŸ’‘ Building the constellation from the top βž” each level must be derivable by aggregating the level below, so the most detailed fact is the one that is physically loaded.

🧠 Active Recall