Slicing a Fact

Context: FIT3003_MOC · Chapter 12 — the opposite move to Multi-Fact Star Schemas: one fact is split, and a multi-fact schema is the by-product Parent Framework: Multi-Fact Star Schemas

Quick Revision

  • 🎯 Objective: partition one fact table into two or more ➔ vertical slices the measure columns, horizontal slices the fact records.
  • 📦 Core Components: vertical vertical partitioning in distributed databases | horizontal horizontal partitioning in parallel databases.
  • ⚡ Key Constraint: the slicing attribute must already be visible somewhere in the schema — a pivoted fact forces a vertical slice, a Type Dimension forces a horizontal one; with neither, the fact cannot be sliced at all.

📝 How It Works

1. Vertical slice — split the measures

  • Definition ➔ divide the fact’s attributes across multiple fact tables; each new fact keeps the full dimension key and takes a subset of the measures.
  • Dimensions untouched ➔ neither the dimension tables nor their records change; only the fact is partitioned.
  • Private Taxi ➔ becomes three one-measure stars, each still hanging off , , .

2. Horizontal slice — split the records

  • Definition ➔ allocate rows to different fact tables by a range or value of an attribute; every new fact keeps the full column list.
  • Dimensions may shrink too ➔ a slice on TimeID means each star’s need only hold that star’s months; a slice on a dimension member means the dimension itself can be split.
  • Bookshop by year ➔ pre- facts to one star, -onward to another.
  • Bookshop by shop type ➔ religious vs general; since holds no type attribute, the membership test must run against the operational database, and the key is renamed per star (BookshopID ➔ ReligiousBookshopID).

3. Which slice — read it off the existing schema

  • Pivoted fact vertical ➔ the breakdown already lives in the column names (Num_of_Bachelor_Projects, Num_of_Master_Projects), so the split is by column.
  • Type dimension horizontal ➔ the breakdown lives in a key attribute value (LevelNo, PilotType), so the split is by row.
  • Neither cannot slice ➔ with only and no level information anywhere, no partition can be derived.
  • The type dimension disappears after the slice ➔ LevelNo is already implied by which star you are querying, so is dropped.
  • A determinant dimension stops being determinant ➔ after slicing Flight Charter, each fact holds one personnel type only, so no double count is possible and / return to solid boxes.

⚙️ Core Implementation

🔹 Vertical slice — project the measures

🔹 Horizontal slice — filter the records

⚖️ Core Decision Matrix

AspectVertical sliceHorizontal slice
What is partitionedmeasure columnsfact records
Analogyvertical partitioning, distributed databaseshorizontal partitioning, parallel databases
Key columnsrepeated in full in every sliceunchanged
Column listnarrower in each sliceidentical in every slice
Dimension tablesuntouchedmay be trimmed to the slice, or split with a renamed key
Triggered bya pivoted fact (breakdown in the column names)a type dimension (breakdown in a key value)
Slicing attribute afterwardsencoded in which measures a fact holdsencoded in which fact you query — the type dimension is dropped

When It Flips: the same case study takes either slice depending on which combined shape was built first — Bachelor/Master pivots ➔ vertical, Bachelor/Master with ➔ horizontal ➔ Combining Star Schemas.

📊 Exam Execution Trace & Applied Exercises

Manual Execution Trace — Flight Charter, both routes

StepStarting schemaSlice appliedResulting facts afterwards
0, dashed , measures—1determinant (dashed)
1pivoted: measures, ..._Pilot / ..._CoPilotvertical — columns split by role2, each measuresnormal (solid)
2type dimension: in the keyhorizontal — rows split on PilotType2, each measuresnormal (solid), dropped
3base schema only, no breakdown anywherenone possible1unchanged
  • Reading the trace ➔ steps 1 and 2 reach the same two star schemas by opposite mechanics; step 3 is the precondition failure.

Applied Exercise — pick the slice

Problem: . Split it into a Bachelor star and a Master star.

Final Extracted Output: two stars, each with the same three dimensions and two measures; had the schema instead carried , the identical outcome would be reached with where LevelNo = 'B' / 'M' — a horizontal slice.

⚠️ Common Mistakes

  • 💡 Slicing when nothing records the slicing attribute ➔ without a pivoted measure or a type dimension the information simply is not in the warehouse; the chapter’s conclusion is that the slice is not possible.
  • 💡 Keeping the type dimension after a horizontal slice ➔ every row in the new fact has the same type value, so the dimension is dead weight.
  • 💡 Assuming the determinant property survives ➔ it exists to prevent a double count that the slice has already eliminated.

🧠 Active Recall