Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 1.41 KB

File metadata and controls

25 lines (20 loc) · 1.41 KB

There are three main ways to make aggregation easier: materialized views, continuous aggregates, and real-time aggregates.

Materialized views are a standard $PG function. They are used to cache the result of a complex query so that you can reuse it later on. Materialized views do not update regularly, although you can manually refresh them as required.

Continuous aggregates are a $TIMESCALE_DB-only feature. They work in a similar way to a materialized view, but they are updated automatically in the background, as new data is added to your database. Continuous aggregates are updated continuously and incrementally, which means they are less resource intensive to maintain than materialized views. Continuous aggregates are based on hypertables, and you can query them in the same way as you do your other tables.

Real-time aggregates are a $TIMESCALE_DB-only feature. They are the same as continuous aggregates, but they add the most recent raw data to the previously aggregated data to provide accurate and up-to-date results, without needing to aggregate data as it is being written.