Skip to main content
Since 1.7.0 Create a policy that automatically refreshes a . To view the policies that you set or the policies that already exist, see informational views.

Samples

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:

Arguments

The syntax is:
The start_offset should be greater than end_offset. You must specify the start_offset and end_offset parameters differently, depending on the type of the time column of the :
  • For s with TIMESTAMP, TIMESTAMPTZ, and DATE time columns, set the offset as an INTERVAL type.
  • For s with integer-based timestamps, set the offset as an INTEGER type.
While setting end_offset to NULL is possible, it is not recommended. To include the data between end_offset and the current time in queries, enable real-time aggregation.
You can add concurrent refresh policies on each , as long as the start_offset and end_offset does not overlap with another policy on the same .
Setting buckets_per_batch greater than zero means that the refresh window is split in batches of bucket width * buckets per batch. For example, a given with bucket width of 1 day and buckets_per_batch of 10 has a batch size of 10 days to process the refresh. Because each batch is an individual transaction, executing a policy in batches make the data visible for the users before the entire job is executed. Batches are processed from the most recent data to the oldest.

Returns