Rapidly growing data means you need more control over what to aggregate and how to aggregate it. With this in mind, Timescale Cloud equips you with tools for more fine-tuned data analysis.
By default, continuous aggregates do not include the most recent data chunk from the underlying hypertable. Real-time aggregates, however, use the aggregated data and add the most recent raw data to it. This provides accurate and up-to-date results, without needing to aggregate data as it is being written.
In TimescaleDB v2.13 and later, real-time aggregates are DISABLED by default. In earlier versions, real-time aggregates are ENABLED by default; when you create a continuous aggregate, queries to that view include the results from the most recent raw data.
For more detail on the comparison between continuous and real-time aggregates,
see our real-time aggregate blog post.
You can enable and disable real-time aggregation by setting the
materialized_only
parameter when you create or alter the view.
Enable real-time aggregation for an existing continuous aggregate:
ALTER MATERIALIZED VIEW table_name set (timescaledb.materialized_only = false);Disable real-time aggregation:
ALTER MATERIALIZED VIEW table_name set (timescaledb.materialized_only = true);
Real-time aggregates automatically add the most recent data when you query your continuous aggregate. In other words, they include data more recent than your last materialized bucket.
If you add new historical data to an already-materialized bucket, it won't be
reflected in a real-time aggregate. You should wait for the next scheduled
refresh, or manually refresh by calling refresh_continuous_aggregate
. You can
think of real-time aggregates as being eventually consistent for historical
data.
For more information, see the troubleshooting section.
Keywords
Found an issue on this page?Report an issue or Edit this page
in GitHub.