Skip to main content

Gold Layer Schema

The Gold layer follows a star schema optimizing storage cost and query performance. Each aggregation type (histogram, histogram2d, statistics) has its own fact/dimension pair linked by visual_id. Fact tables join back to containers via container_id and to events via event_id or event_instance_id.

All gold-layer table names are prefixed with the configured table_prefix from the report's sink config (e.g. with table_prefix: "my_report" the histogram fact table becomes my_report_histogram_fact).

Entity-relationship diagram

The measurement_dimension table also contains additional columns selected dynamically from config.measurement_dimensions at run time — only container_id, config_hash, and _created_at are guaranteed.


Fact tables

TableKey columnsDescription
{prefix}_histogram_factcontainer_id, visual_id, event_id, bin_id1D histogram bin values per container.
{prefix}_histogram2d_factcontainer_id, visual_id, event_id, x_bin_id, y_bin_id2D histogram bin values per container.
{prefix}_stats_aggregator_factcontainer_id, visual_id, event_instance_id, channel_name, aggregation_labelStatistics values per signal, event instance, and container.
{prefix}_event_instance_factcontainer_id, event_id, event_instance_idMaterialized event occurrences with start/end timestamps.

Dimension tables

TableKey columnsDescription
{prefix}_histogram_dimensionvisual_id, report_idHistogram metadata (name, bins, signal info, units).
{prefix}_histogram2d_dimensionvisual_id, report_id2D histogram metadata (axes, bins, signal info, units).
{prefix}_stats_aggregator_dimensionvisual_id, report_idStatistics metadata (signals, aggregation labels).
{prefix}_event_dimensionevent_id, report_idEvent definitions (name, expression, required channels).
{prefix}_measurement_dimensioncontainer_idContainer metadata. Always carries container_id, config_hash, _created_at; additional columns are populated from config.measurement_dimensions.