Skip to main content
Early access Since 2.10.0 Add refresh, compression, and data retention policies to a in one step. The added compression and retention policies apply to the , not to the original .
add_policies() does not allow the schedule_interval for the to be set, instead using a default value of 1 hour.If you would like to set this add your policies manually (see add_continuous_aggregate_policy).

Samples

Given a named example_continuous_aggregate, add three policies to it:
  1. Regularly refresh the to materialize data between 1 day and 2 days old.
  2. Compress data in the after 20 days.
  3. Drop data in the after 1 year.

Arguments

The syntax is:
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

Returns true if successful.