---
title: Real-time aggregates | Tiger Data Docs
description: Real-time aggregates combine pre-aggregated data with the most recent raw data for up-to-date results
---

High-ingest workloads need aggregates that blend historical rollups with the live tail without blocking writers.

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 aggregates and real-time aggregates, see the [real-time aggregate blog post](https://tigerdata.com/blog/achieving-the-best-of-both-worlds-ensuring-up-to-date-results-with-real-time-aggregation/).

## Use real-time aggregates

You can enable and disable real-time aggregation by setting the `materialized_only` parameter when you create or alter the view.

1. **Enable real-time aggregation**

   ```
   ALTER MATERIALIZED VIEW table_name set (timescaledb.materialized_only = false);
   ```

2. **Disable real-time aggregation**

   ```
   ALTER MATERIALIZED VIEW table_name set (timescaledb.materialized_only = true);
   ```

## Real-time aggregates and refreshing historical data

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.

## Learn more

- [Understand continuous aggregates](/docs/learn/continuous-aggregates/index.md): How continuous aggregates work, JOINs, and function support.
- [Create a continuous aggregate](/docs/build/continuous-aggregates/create-a-continuous-aggregate/index.md): Step-by-step guide to creating a continuous aggregate with real-time aggregation.
- [Refresh continuous aggregates](/docs/build/continuous-aggregates/refresh-policies/index.md): Control how often materialized data is updated.
- [Troubleshoot continuous aggregates](/docs/build/tips-and-tricks/troubleshoot-continuous-aggregates/index.md): Common issues and solutions.
- [`ALTER MATERIALIZED VIEW` reference](/docs/reference/timescaledb/continuous-aggregates/alter_materialized_view/index.md): Toggle `materialized_only` and other settings.

For more information, see the [troubleshooting section](/docs/build/tips-and-tricks/troubleshoot-continuous-aggregates/index.md).
