Add refresh, compression, and data retention policies to a continuous aggregate in one step. The added compression and retention policies apply to the continuous aggregate, not to the original hypertable.
Experimental features could have bugs. They might not be backwards compatible, and could be removed in future releases. Use these features at your own risk, and do not use any experimental features in production.
add_policies() does not allow the
schedule_interval for the continuous aggregate to be set, instead using a default value of 1 hour.
If you would like to set this add your policies manually (see
|The continuous aggregate that the policies should be applied to
|When true, prints a warning instead of erroring if the continuous aggregate doesn't exist. Defaults to false.
|The start of the continuous aggregate refresh window, expressed as an offset from the policy run time.
|The end of the continuous aggregate refresh window, expressed as an offset from the policy run time. Must be greater than
|Continuous aggregate chunks are compressed if they exclusively contain data older than this interval.
|Continuous aggregate chunks are dropped if they exclusively contain data older than this interval.
For arguments that could be either an
INTERVAL or an
INTEGER, use an
INTERVAL if your time bucket is based on timestamps. Use an
INTEGER if your
time bucket is based on integers.
Returns true if successful.
Given a continuous aggregate named
example_continuous_aggregate, add three
policies to it:
- Regularly refresh the continuous aggregate to materialize data between 1 day and 2 days old.
- Compress data in the continuous aggregate after 20 days.
- Drop data in the continuous aggregate after 1 year.
Found an issue on this page?Report an issue!