diff --git a/_partials/_caggs-intro.md b/_partials/_caggs-intro.md index 1973b2610b..fdf8f71d0c 100644 --- a/_partials/_caggs-intro.md +++ b/_partials/_caggs-intro.md @@ -8,12 +8,28 @@ temperature readings taken every second, you can find the average temperature for each hour. Every time you run this query, the database needs to scan the entire table and recalculate the average every time. -Continuous aggregate views are refreshed automatically in the background as new -data is added, or old data is modified. Timescale tracks these changes to the -dataset, and automatically updates the view in the background. This does not add -any maintenance burden to your database, and does not slow down `INSERT` -operations. +Continuous aggregates are a kind of hypertable that is refreshed automatically +in the background as new data is added, or old data is modified. Changes to your +dataset are tracked, and the hypertable behind the continuous aggregate is +automatically updated in the background. + +You don't need to manually refresh your continuous aggregates, they are +continuously and incrementally updated in the background. Continuous aggregates +also have a much lower maintenance burden than regular PostgreSQL materialized +views, because the whole view is not created from scratch on each refresh. This +means that you can get on with working your data instead of maintaining your +database. + +Because continuous aggregates are based on hypertables, you can query them in +exactly the same way as your other tables, and enable [compression][compression] +or [data tiering][data-tiering] on your continuous aggregates. You can even +create +[continuous aggregates on top of your continuous aggregates][hierarchical-caggs]. By default, querying continuous aggregates provides you with real-time data. Pre-aggregated data from the materialized view is combined with recent data that hasn't been aggregated yet. This gives you up-to-date results on every query. + +[data-tiering]: /use-timescale/:currentVersion:/data-tiering/ +[compression]: /use-timescale/:currentVersion:/compression/ +[hierarchical-caggs]: /use-timescale/:currentVersion:/continuous-aggregates/hierarchical-continuous-aggregates/ diff --git a/_partials/_caggs-types.md b/_partials/_caggs-types.md index 19921b6b4c..55c968a516 100644 --- a/_partials/_caggs-types.md +++ b/_partials/_caggs-types.md @@ -1,16 +1,18 @@ -There are three main types of aggregation: materialized views, continuous -aggregates, and real time aggregates. +There are three main ways to make aggregation easier: materialized views, +continuous aggregates, and real time aggregates. [Materialized views][pg-materialized views] are a standard PostgreSQL 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][about-caggs] are a Timescale only feature. They work in a similar way -to a materialized view, but they are refreshed automatically. Continuous -aggregates update to a set point in time called the materialization threshold, -which means that they do not include the most recent data chunk from the -underlying hypertable. +[Continuous aggregates][about-caggs] are a Timescale 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][real-time-aggs] are a Timescale only feature. They are the same as continuous aggregates, but they add the most recent raw data to the diff --git a/getting-started/aggregation.md b/getting-started/aggregation.md index 882118d5af..a05eeac758 100644 --- a/getting-started/aggregation.md +++ b/getting-started/aggregation.md @@ -13,11 +13,19 @@ import CandlestickIntro from "versionContent/_partials/_candlestick_intro.mdx"; # Aggregation -Aggregation refers to a number of different calculations that you can perform on -your data. For example, if you have data showing temperature changes over time, -you can calculate an average of those temperatures, or a count of how many -readings have been taken. Average, sum, and count are all example of simple -aggregates. +Aggregation is a way of combing data to get insights from it. At its simplest, +aggregation is something like looking for an average. For example, if you have +data showing temperature changes over time, you can calculate an average of +those temperatures, or a count of how many readings have been taken. Average, +sum, and count are all example of simple aggregates. + +However, aggregation calculations can get big and slow, quickly. If you want to +find the average open and closing values of a range of stocks for each day, then +you need something a little more sophisticated. That's where Timescale +continuous aggregates come in. Continuous aggregates can minimize the number of +records that you need to look up to perform your query. + +## Continuous aggregates