Query engine with automatic tier selection.
For raw queries, reads compressed segments from shard storage. For aggregate queries, reads from rollup tiers when the time range falls outside raw retention, or when a matching tier resolution exists. Stitches results across tiers for queries spanning multiple windows.
Summary
Functions
Query with aggregation. Automatically selects the best tier.
Query the latest value for a series. Checks raw segments first (from shard DB), then falls back to the finest rollup tier.
Query raw points for a series within a time range.
Read pre-computed rollup data directly from a tier table.
Functions
Query with aggregation. Automatically selects the best tier.
When a schema is provided, the query router will read from rollup tables if the data is available there, falling back to raw segments.
Returns {:ok, [{bucket_timestamp, aggregate_value}, ...]}.
Query the latest value for a series. Checks raw segments first (from shard DB), then falls back to the finest rollup tier.
Query raw points for a series within a time range.
Reads from the shard DB that owns this series_id.
Returns {:ok, [{timestamp, value}, ...]} sorted by timestamp.
Read pre-computed rollup data directly from a tier table.
Returns {:ok, [%{bucket: ts, avg: v, min: v, max: v, count: n, sum: v, last: v}, ...]}.