Create a policy that automatically refreshes a continuous aggregate.
|REGCLASS||The continuous aggregate to add the policy for|
|INTERVAL or integer||Start of the refresh window as an interval relative to the time when the policy is executed. |
|INTERVAL or integer||End of the refresh window as an interval relative to the time when the policy is executed. |
|INTERVAL||Interval between refresh executions in wall-clock time. Defaults to 24 hours|
start_offset should be greater than
You must specify the
end_offset parameters differently,
depending on the type of the time column of the hypertable:
- For hypertables with
DATEtime columns, set the offset as an
- For hypertables with integer-based timestamps, set the offset as an
NULL is possible, it is not recommended. To include the most recent data in your aggregates, use real-time aggregation instead.
|BOOLEAN||Set to |
|INTEGER||TimescaleDB background job ID created to implement this policy|
Add a policy that refreshes the last month once an hour, excluding the latest hour from the aggregate. For performance reasons, we recommend that you exclude buckets that see lots of writes:
SELECT add_continuous_aggregate_policy('conditions_summary', start_offset => INTERVAL '1 month', end_offset => INTERVAL '1 hour', schedule_interval => INTERVAL '1 hour');
Found an issue on this page?Report an issue!