← Back to Learn
ADVANCED PATTERN

Rectangle Decomposition

Aligns independently changing attribute histories by decomposing overlapping valid-time and visible-time intervals into deterministic bitemporal regions.

Decomposes complex temporal projections into deterministic bitemporal regions that can be validated and queried reliably.

Problem

Multiple independently changing histories cannot be projected into one row without temporal alignment.

An entity can have many independently historized attributes stored as attribute rows. Each attribute can have its own valid-time and visible-time history.

When independent histories are combined, simple joins can create overlapping combinations that never existed as a real business state.

When those attributes are projected into one reporting row, the result needs one shared bitemporal interval. Without decomposition, the output can contain overlapping or ambiguous historical states.

Bitemporal overlapsInvalid projectionsDuplicate reporting rowsAmbiguous historical states
Example

Two independently historized attributes are decomposed into stable bitemporal rectangles.

Bitemporal rectangle decomposition
1. Source rectangles2. Boundary extraction3. Atomic rectangles4. Compacted resultvisible ↑valid →ABvisible ↑valid →ABvisible ↑valid →AAAA+BBBBvisible ↑valid →AAA+BBBAttributes have different valid and visibleintervals.Project every real source edge onto the validand visible axes.Fill only regions covered by A, B, or both.Compact only along valid time wherethe resolved values stay identical.
Key rule

Rectangle Decomposition does not create arbitrary time buckets. It splits only at real source boundaries and resolves the active attribute combination per atomic rectangle. After decomposition, neighbouring rectangles can be compacted along valid time when the resolved attribute combination stays identical.

Core concepts

Turning independent attribute histories into one consistent bitemporal representation.

Rectangle decomposition resolves independently historized attributes into stable bitemporal regions.

Instead of joining overlapping histories directly, the pattern extracts real temporal boundaries, creates atomic rectangles and assigns one resolved attribute combination to each region.

The result is a structure that can be validated, queried and consumed by reporting systems without ambiguous historical states.

Test case

Analyze this Rectangle Decomposition example

Use these sample target tables to test the validator:

  1. Copy one of the target tables below.
  2. Start an investigation with this example data.
  3. Paste the copied table as your target output.
  4. Check whether overlapping attribute projections were decomposed.
Decomposed target table

Copy this table to validate the expected decomposed reporting intervals.

entity_id,valid_from,valid_to,visible_from,visible_to,risk_code,coverage_code,decomposition_status
P1,2024-01-01,2024-03-31,2024-01-01,9999-12-31,R1,C1,decomposed
P1,2024-04-01,2024-06-30,2024-01-01,9999-12-31,R2,C2,decomposed
P1,2024-07-01,2024-12-31,2024-01-01,9999-12-31,R2,C2,decomposed
Wrong target table

Copy this table to validate an output where overlapping intervals were not decomposed.

entity_id,valid_from,valid_to,visible_from,visible_to,risk_code,coverage_code,decomposition_status
P1,2024-01-01,2024-06-30,2024-01-01,9999-12-31,R1,C1,not_decomposed
P1,2024-04-01,2024-12-31,2024-01-01,9999-12-31,R2,C2,not_decomposed
Why it happens

Independent attributes create independent temporal boundaries.

Different source systems capture changes at different moments. Each attribute therefore represents a partial view of the same entity with its own valid-time and visible-time history.

When these histories are combined directly, overlapping projections can create combinations that never existed as a real business state.

Rectangle Decomposition reconciles these independent histories by creating deterministic temporal regions with one resolved attribute combination per region.

Independent attribute historyTemporal boundary alignmentBitemporal dimensionsResolved historical stateStable reporting rowsState reduction
Validation checks

Validate that the projected output is bitemporally stable.

No bitemporal overlaps after decompositionOne resolved combination per rectangleCovered source area is preservedEmpty regions are not materialized as factsAdjacent identical states can be compacted safely
Why it matters

Rectangle Decomposition turns independent attribute history into one reportable history.

Without Rectangle Decomposition, the same entity and reporting date can produce multiple possible attribute combinations.

With decomposition, each output row represents one entity, one bitemporal rectangle and one stable historical truth.

RELATED TEMPORAL MODELS

How this pattern relates to other temporal models

Rectangle decomposition does not replace temporal models. It prepares complex histories by resolving overlapping temporal regions before reporting and analytical models consume the data.

Bitemporal Modeling
Defines valid-time and visible-time semantics. Rectangle decomposition uses these dimensions to create stable temporal regions.
Historical Overlap
Describes conflicting temporal projections. Rectangle decomposition resolves overlaps into deterministic regions.
State Reduction
Compacts neighbouring regions after identical historical states have been resolved.
Snapshot Reproducibility
Uses stable temporal structures to reproduce reliable point-in-time views.

This pattern is especially useful when corrections arrive frequently, attributes change independently or reporting requires one consistent historical truth.

Related Patterns
State ↔ State AlignmentHistorical ConformanceHistorical OverlapState ReductionSnapshot Reproducibility
Try it

Explore bitemporal alignment problems in the Workbench.

Use the Historical Modeling Workbench to reason about bitemporal overlaps, temporal joins, coverage gaps and stable reporting intervals.

Open Historical Modeling Workbench →