From e7156a0121de7763e8b85038f8f779b3ffbd7e2a Mon Sep 17 00:00:00 2001 From: loquacity Date: Mon, 7 Aug 2023 17:24:13 +1000 Subject: [PATCH 1/3] Slight edits to intro caggs sections --- _partials/_caggs-intro.md | 17 ++++++++++++----- _partials/_caggs-types.md | 14 +++++++------- getting-started/aggregation.md | 17 ++++++++++++----- 3 files changed, 31 insertions(+), 17 deletions(-) diff --git a/_partials/_caggs-intro.md b/_partials/_caggs-intro.md index 1973b2610b..e1fa5ac266 100644 --- a/_partials/_caggs-intro.md +++ b/_partials/_caggs-intro.md @@ -8,12 +8,19 @@ 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. This does not add any maintenance +burden to your database, and does not slow down `INSERT` operations. + +Because continuous aggregates are based on hypertables, you can query them in +exactly the same way as your other tables. You can even do things like enable +[data tiering][data-tiering] or [compression][compression] on your continuous aggregates. 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:/copmpression/ diff --git a/_partials/_caggs-types.md b/_partials/_caggs-types.md index 19921b6b4c..15b5a0d7f1 100644 --- a/_partials/_caggs-types.md +++ b/_partials/_caggs-types.md @@ -1,16 +1,16 @@ -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 refreshed automatically in +the background, as new data is added to your database. 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..c219c4b625 100644 --- a/getting-started/aggregation.md +++ b/getting-started/aggregation.md @@ -13,11 +13,18 @@ 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 complicated, 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 From b01c6b24ff0666e22f39dc4f98c88a6c6a13d10d Mon Sep 17 00:00:00 2001 From: Lana Brindley Date: Mon, 7 Aug 2023 18:30:51 +1000 Subject: [PATCH 2/3] Update _partials/_caggs-intro.md Co-authored-by: Rajakavitha Kodhandapani Signed-off-by: Lana Brindley --- _partials/_caggs-intro.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_partials/_caggs-intro.md b/_partials/_caggs-intro.md index e1fa5ac266..6f983c3eb0 100644 --- a/_partials/_caggs-intro.md +++ b/_partials/_caggs-intro.md @@ -15,7 +15,7 @@ automatically updated in the background. This does not add any maintenance burden to your database, and does not slow down `INSERT` operations. Because continuous aggregates are based on hypertables, you can query them in -exactly the same way as your other tables. You can even do things like enable +exactly the same way as your other tables. You can even enable [data tiering][data-tiering] or [compression][compression] on your continuous aggregates. By default, querying continuous aggregates provides you with real-time data. From 2257fc2b30262fb874e4e94e8051956ce5c1a7ac Mon Sep 17 00:00:00 2001 From: loquacity Date: Mon, 14 Aug 2023 17:59:23 +1000 Subject: [PATCH 3/3] edits per feedback --- _partials/_caggs-intro.md | 19 ++++++++++++++----- _partials/_caggs-types.md | 10 ++++++---- getting-started/aggregation.md | 5 +++-- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/_partials/_caggs-intro.md b/_partials/_caggs-intro.md index 6f983c3eb0..fdf8f71d0c 100644 --- a/_partials/_caggs-intro.md +++ b/_partials/_caggs-intro.md @@ -11,16 +11,25 @@ entire table and recalculate the average every time. 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. This does not add any maintenance -burden to your database, and does not slow down `INSERT` operations. +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. You can even enable -[data tiering][data-tiering] or [compression][compression] on your continuous aggregates. +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:/copmpression/ +[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 15b5a0d7f1..55c968a516 100644 --- a/_partials/_caggs-types.md +++ b/_partials/_caggs-types.md @@ -7,10 +7,12 @@ 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 in -the background, as new data is added to your database. Continuous aggregates are -based on hypertables, and you can query them in the same way as you do your -other tables. +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 c219c4b625..a05eeac758 100644 --- a/getting-started/aggregation.md +++ b/getting-started/aggregation.md @@ -19,10 +19,11 @@ 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 complicated, quickly. If you want to +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 come in. Continuous aggregates can minimize the number of +records that you need to look up to perform your query. ## Continuous aggregates