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
Mermaid β the -fact lattice, arrows pointing at the more aggregated schema
flowchart BT BQ["Branch Quarterly β Level-1"] BY["Branch Yearly β Level-2"] CQ["City Quarterly β Level-2"] CY["City Yearly β Level-3"] NQ["Country Quarterly β Level-3"] NY["Country Yearly β Level-4"] BQ --> BY BQ --> CQ BY --> CY CQ --> CY CQ --> NQ BY --> NQ CY --> NY NQ --> NYπ‘ Common Mistake: Flattening the lattice into β that numbering claims Quarterly Country Sales is more general than Yearly City Sales, which is false; the lattice has only four levels, two of them holding two schemas each.
π Exam Execution Trace & Applied Exercises
Manual Execution Trace β comparing two schemas in the constellation
| Pair | Location axis | Time axis | Verdict |
|---|---|---|---|
| Country Yearly vs Country Quarterly | equal | coarser | Country Yearly is more general |
| Country Yearly vs Branch Yearly | coarser | equal | Country Yearly is more general |
| Country Quarterly vs City Yearly | coarser | finer | not comparable |
| Branch Yearly vs City Quarterly | finer | coarser | not comparable |
| Branch Quarterly vs anything | finest | finest | strictly 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
A warehouse has a Branch β City β Country hierarchy and a Quarter β Year hierarchy. How many fact tables, how many levels, and why are those numbers different?
Answer
- Short answer: fact tables but only four levels of aggregation.
- Why: Facts are the cross product β each combination of one location grain and one time grain is a separate materialised aggregate. Levels are lattice ranks β a schemaβs rank is how many coarsening steps separate it from Branch Quarterly, so Branch Yearly and City Quarterly both sit at rank . Ranks collide because axes are independent β those two schemas coarsen different hierarchies, which is exactly why they cannot be ordered against each other β Fact Constellation.