Querying a continuous aggregate
At the
psqlprompt, query the continuous aggregate view calledconditions_summary_hourlyfor the average, minimum, and maximum temperatures for the first quarter of 2021 recorded by device 5:Alternatively, query the continuous aggregate view called
conditions_summary_hourlyfor the top 20 largest metric spreads in that quarter:
Use continuous aggregates with mutable functions: experimental
Mutable functions have experimental supported in the continuous aggregate query definition. Mutable functions are enabled by default. However, if you use them in a materialized query a warning is returned.
When using non-immutable functions you have to ensure these functions produce consistent results across continuous aggregate refresh runs. For example, if a function depends on the current time zone you have to ensure all your continuous aggregate refreshes run with a consistent setting for this.
Use continuous aggregates with window functions: experimental
Window functions have experimental supported in the continuous aggregate query definition. Window functions are disabled by default. To enable them, set timescaledb.enable_cagg_window_functions to true.
Support is experimental, there is a risk of data inconsistency. For example, in backfill scenarios, buckets could be missed.