Optional arguments
| Name | Type | Description |
|---|---|---|
force | BOOLEAN | Force refresh every bucket in the time range between window_start and window_end, even when the bucket has already been refreshed. This can be very expensive when a lot of data is refreshed. Default is FALSE. |
refresh_newest_first | BOOLEAN | Set to FALSE to refresh the oldest data first. Default is TRUE. |
===== PAGE: https://docs.tigerdata.com/api/continuous-aggregates/remove_policies/ =====
Examples:
Example 1 (sql):
sql
CALL refresh_continuous_aggregate('conditions', '2020-01-01', '2020-02-01');Example 2 (sql):
sql
DO
$$
DECLARE
refresh_interval INTERVAL = '12h'::INTERVAL;
start_timestamp TIMESTAMPTZ = '2020-01-01T00:00:00Z';
end_timestamp TIMESTAMPTZ = start_timestamp + refresh_interval;
BEGIN
WHILE start_timestamp < '2020-02-01T00:00:00Z' LOOP
CALL refresh_continuous_aggregate('conditions', start_timestamp, end_timestamp);
COMMIT;
RAISE NOTICE 'finished with timestamp %', end_timestamp;
start_timestamp = end_timestamp;
end_timestamp = end_timestamp + refresh_interval;
END LOOP;
END
$$;Example 3 (sql):
sql
CALL refresh_continuous_aggregate('conditions', '2020-01-01', '2020-02-01', force => TRUE);