Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slight edits to intro caggs sections #2602

Merged
merged 9 commits into from
Aug 28, 2023
26 changes: 21 additions & 5 deletions _partials/_caggs-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loquacity marked this conversation as resolved.
Show resolved Hide resolved
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/
16 changes: 9 additions & 7 deletions _partials/_caggs-types.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
18 changes: 13 additions & 5 deletions getting-started/aggregation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

<CaggsIntro />

Expand Down