DB
Concepts

Attribute projections

How attribute tables serve latest state quickly while preserving exact temporal reconstruction.

An attribute table stores each attribute in a typed value stream. Its projection is a wide, keyed current-state relation used by default latest reads.

Default latest read

SELECT account_id, balance, tier
FROM account_state
WHERE account_id = 42;

The binder retargets this read to the engine-owned latest projection. EXPLAIN shows the physical projection relation rather than a scan of every attribute history stream.

Asynchronous maintenance, synchronous visibility

Projection maintenance is asynchronous, but a default read compares the projection watermark with the attribute value streams. If maintenance is behind, the read overlays the exact unreflected suffix before returning.

This gives two paths:

StateRead behavior
Projection caught upScan the wide projection directly.
Projection behindScan the projection and overlay the value-stream suffix.

The overlay preserves read-your-writes. Asynchronous maintenance affects the amount of work a read performs, not the committed answer it returns.

Temporal reconstruction

FOR SYSTEM_TIME AS OF n and FOR VALID_TIME AS OF n reconstruct from the typed attribute streams at the requested cutoff:

SELECT account_id, balance, tier
FROM account_state
FOR SYSTEM_TIME AS OF 1000
WHERE account_id = 42;

Typed tuple keys frame composite entity and time axes injectively, so values such as text delimiters cannot alias a different entity key.

Projection controls

Attribute-table settings include:

  • entity=(...) — required entity key columns;
  • valid_by=(...) and revision_by=(...) — optional temporal axes;
  • projection='off' — disable the default projection where supported;
  • spillover='on' — enable the bounded spillover path;
  • max_attributes=n — 1 through 512.

Projection relations use reserved engine names and do not appear as user tables. system.attributes is the supported catalog view.

Current limits

Attribute tables are local single-node state. Streaming and materialized-view compositions over attribute latest reads have explicit binder restrictions; the engine rejects an unsafe shape instead of silently serving stale state. Verify the plan with EXPLAIN and treat transform/stream integration as Experimental.

On this page