The classic schema of a relational data warehouse: a fact table in the centre, dimension tables around it — together the picture looks like a star. This layout arose to serve analytics: instead of storing transactions, the business needs to compute sums and groupings quickly — sales by month, region and product.
Facts and dimensions
A fact table stores events and their numeric measures: sales, payments, sensor readings. One row is one event at a given grain, for example a single line item on a receipt. Where possible, its numbers are made additive — they can be freely summed along any dimension: instead of the price, the line amount is stored.
Dimension tables answer the questions “who, what, where, when”: product, store, date, customer. Each contains a surrogate key and the descriptive attributes with which reports filter and group facts. That is why dimensions are deliberately denormalised: one flat product, with category and brand in the same row.
| Table | Contents | Number of rows |
|---|---|---|
fact_sales | dimension keys, line amount, quantity, discount | billions |
dim_date | date, year, quarter, month, day of week | thousands |
dim_store | store, city, region, type | hundreds |
dim_product | product, category, brand | tens of thousands |
Why a star
There is always just one join, and it is simple: a key in the fact table to a dimension key. A typical analytical query joins the fact table to several dimensions, then filters and groups the data by their attributes — and it is the dimensions that give reports the entry points for this. It is exactly these single-key joins that make the star fast and predictable in query plans.
Ralph Kimball introduced dimensional modelling, the star schema included, into practice in 1996 with the book The Data Warehouse Toolkit.
Star and snowflake
The snowflake schema is a variant with normalised dimensions: a product category is moved into a separate table and linked to the product instead of sitting in its row. The star is the more common choice: as Kimball observed, the benefit of a single flat dimension table usually wins out, and the final choice depends on data volumes and reporting needs.
Sources
the term is written from these pages- Kimball Group — Dimensional Modeling Techniqueskimballgroup.com/data-warehouse-business-intelligence-resources/kimball-techniques/dimensional-modeling-techniques/(opens in a new tab)
- Microsoft Learn — Understand star schema and the importance for Power BIlearn.microsoft.com/en-us/power-bi/guidance/star-schema(opens in a new tab)
Verified 9 Nov