Columnar series
Compact storage with per-column codecs, with STORAGE PROFILE COLUMNAR.
Store series compactly, aggregate them over time windows as they arrive, and keep per-series rollups current, all in the same SQL.
The problem
Time-series work wants two things at once: raw resolution to investigate and coarse aggregates to watch. Meeting both usually means a hot store for recent data, a rollup job that downsamples into a warehouse, and glue between them. Several moving parts around one stream.
The rollup job is a stream processor in disguise. It exists only because the store cannot aggregate its own data as it arrives.
You want an engine that stores readings compactly, aggregates them over windows as they arrive, and keeps per-series summaries current in the same SQL.
Architecture
Raw readings land in a columnar table with delta-style codecs on the time column; STREAM SELECT over TUMBLE, HOP or SESSION windows emits each aggregate when its window closes; grouped transformations keep per-series totals in a keyed table.
Readings land in a COLUMNAR table; DoubleDelta and ZSTD codecs compress the time and value columns.
Aggregate by event time or processing time over HOP or TUMBLE windows in STREAM SELECT, and release each window once with EMIT AFTER WINDOW CLOSE.
Per-series counts, sums, minimums and maximums stay current in a keyed table, maintained by a grouped transformation.
Scans over history skip what they do not need, thanks to a MINMAX index on the time column.
Examples
CREATE TABLE transfers ( chain_id UINT16 NOT NULL, token STRING NOT NULL, sender STRING NOT NULL, recipient STRING NOT NULL, amount UINT256 NOT NULL, transferred_at DATETIME64(3, 'UTC') NOT NULL, _index UINT128 NOT NULL, INDEX transfers_ts (transferred_at) USING MINMAX SCOPE HISTORY GRANULE 8192)MODE APPENDSHARD BY (token) SHARDS AUTOPARTITION BY MONTH(transferred_at)ORDER BY (chain_id, token, _index)STORAGE PROFILE COLUMNAR;STREAM SELECT window_start, window_end, token, COUNT() AS transfersFROM TUMBLE(transfers, transferred_at, INTERVAL 1 MINUTE)GROUP BY window_start, window_end, tokenEMIT AFTER WINDOW CLOSE;STREAM SELECT chain_id, token, SUM(amount) AS volume, COUNT(*) AS transfersFROM transfersGROUP BY chain_id, token;The examples use the same two tables on every page. See the SQL reference for full syntax.
Capabilities
Compact storage with per-column codecs, with STORAGE PROFILE COLUMNAR.
By event time or processing time, with TUMBLE, HOP or SESSION in STREAM SELECT.
Each window is released once, when it closes, with EMIT AFTER WINDOW CLOSE.
Summaries stay current in a keyed table, maintained by grouped transformations.
Range predicates on time skip the parts that cannot match.
Incremental changes arrive as commits land, from a grouped STREAM SELECT.
Learn more
Ingest, window and summarize, all in SQL.