docs / data / schema
Star Schema v3
Constellation schema — 7 fact tables, 7 dimensions, 1 materialised view. As-built reflects the gold layer that create_gold.py creates and KNIME writes into.
Updated May 2026 — see changelog below.
🔑 primary key · 🔗 foreign key · PBI = Power BI · SAC = SAP Analytics Cloud
← click any table to inspect it
changelog — changes based on feedback
Weather is numeric and aggregatable, so it's a fact, not a dimension. Stored at hourly grain with prediction_date in the PK to keep multiple forecast revisions.
Separated date and time: dim_datetime at minute grain for sensor facts, dim_date at day grain for weather and device health.
dim_sensor and dim_device had a redundant hierarchy. In our data, the sensor is an attribute of the device (sensor_type). One dimension is enough.
fact_sensor_reliability was not linked to dim_room. Fixed: fact_device_health_day includes room_key for spatial reliability analysis.
KNIME's DB Writer creates each table from its own workflow output, with apartment/room/model_name/target as denormalised string columns. Two facts were simpler than one fact + four extra dims (model/target/horizon).
Energy tariff joined to fact_energy_minute via the materialised view mv_energy_with_cost — derives cost_chf without polluting the fact table.
access control — issues #23 & #24
role
issue
accessible tables
filter
Owner
Issue #23
Row-level: own apartment only (dim_apartment.owner_user_id)
Renter
Issue #23
Row-level: own apartment only
all tables
facts
dimensions