← Back to Pattern Catalog
Interactive Pattern

Rectangle Decomposition

Rectangle Decomposition creates stable reporting intervals from multiple independently historized attributes.

Problem

Multiple bitemporal attributes cannot be safely projected into one row without 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.

This pattern is commonly used when multiple bitemporal attributes must be projected into a single reporting entity.

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 visible intervals.Project every real source edge onto the valid and 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.

Test case

Try this Rectangle Decomposition case in Target Table Validation

Use these sample target tables to test the validator:

  1. Copy one of the target tables below.
  2. Open Target Table Validation.
  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
Open Target Table Validation →
Why it happens

Each attribute creates its own valid-time and visible-time boundaries.

Attributes can evolve independently. The reason for different histories is often source-specific and not obvious. Rectangle Decomposition does not explain why the histories differ — it makes them safely reportable.

The pattern preserves the covered bitemporal area, decomposes it into atomic regions with stable attribute combinations, and can then compact neighbouring regions with identical resolved values.

Independent attribute historyAttribute projectionBitemporal dimensionsSource-specific historyStable reporting rowsState reduction
Typical solutions

Decompose first, resolve attributes, then compact if possible.

Collect boundaries
Gather every valid_from, valid_to, visible_from and visible_to boundary from all relevant attribute rows.
Build atomic rectangles
Split the valid × visible plane only at real source boundaries, not at arbitrary time buckets.
Resolve combinations
For each atomic rectangle, determine which attributes are active and visible.
Compact stable states
Merge neighbouring rectangles along valid time when the resolved attribute combination is identical.
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 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 →