Databases

Temporal Tables: Point-in-Time Schema

ER Diagrams · made in Skemio

ER diagram showing accounts, account_history, and balance_snapshots linked with valid_from and valid_to timestamp columns for point-in-time queries.
ER diagram showing accounts, account_history, and balance_snapshots linked with valid_from and valid_to timestamp columns for point-in-time queries.

What it shows

  • valid_from & valid_to timestamps track exact lifespan intervals per row
  • Open-ended active rows use NULL or infinity for valid_to
  • Range-containment queries eliminate tedious audit log parsing

The takeaway

Store valid-time ranges directly on snapshots to query past state without reconstructing logs.

More er diagrams