Skip to content

Update the CAGGS docs with the end_offset within the current bucket nuance #3991

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

Merged
merged 10 commits into from
Apr 15, 2025
22 changes: 10 additions & 12 deletions use-timescale/continuous-aggregates/refresh-policies.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,16 @@ Among others, `add_continuous_aggregate_policy` takes the following arguments:
24 hours.

If you set the `start_offset` or `end_offset` to `NULL`, the range is open-ended
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If you set the `start_offset` or `end_offset` to `NULL`, the range is open-ended
If you set `start_offset` or `end_offset` to `NULL`, the range is open-ended

and extends to the beginning or end of time. However, it's recommended to set
the `end_offset` so that at least the most recent time bucket is excluded. For
time-series data that mostly contains writes that occur in time stamp order, the
time buckets that see lots of writes quickly have out-of-date aggregates. You
get better performance by excluding the time buckets that are getting a lot of
writes.

In addition, materializing the most recent bucket might interfere with
[real-time aggregation][future-watermark].

See the [API reference][api-reference]
for the full list of required and optional arguments and use examples.
and extends to the beginning or end of time.

If you set `end_offset` within the current time bucket, this bucket is excluded. This is done for the following reasons:

- The current bucket is incomplete and can't be refreshed.
- The current bucket gets lots of writes in the time-stamp order and its aggregate becomes outdated very quickly. Excluding it improves performance.

To include the current time bucket, enable [real-time aggregation][future-watermark]. In Timescale 2.13 and later, it is disabled by default.

See the [API reference][api-reference] for the full list of required and optional arguments and use examples.

<Procedure>

Expand Down