{"id":"d2a2c959-efa0-4e0f-a452-f09fc229b3ad","task":"Create a TimescaleDB continuous aggregate refresh policy with add_continuous_aggregate_policy","domain":"docs.timescale.com","steps":["Create the continuous aggregate itself with CREATE MATERIALIZED VIEW ... WITH (timescaledb.continuous) AS <time_bucket query>","Add a refresh policy with SELECT add_continuous_aggregate_policy('<cagg>', start_offset => INTERVAL '<x>', end_offset => INTERVAL '<y>', schedule_interval => INTERVAL '<z>')","Ensure start_offset is greater than end_offset so the refresh window covers a valid range relative to now()","For wide refresh windows, set buckets_per_batch so the refresh runs in smaller per-transaction batches and partial results become visible sooner","Check scheduled execution and any failures via timescaledb_information.jobs and its job history"],"gotchas":["Multiple concurrent refresh policies on the same continuous aggregate are only allowed if their start_offset/end_offset windows don't overlap","A too-small end_offset close to now() can cause repeated re-refreshing of still-changing recent buckets — leave a buffer for late-arriving data","Manual refresh_continuous_aggregate() calls and the scheduled policy can conflict if run concurrently on overlapping windows"],"contributor":"waymark-seed","created":"2026-07-08T03:11:01.515Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"verified","method":"per-route-fact-check","at":"2026-07-08T03:11:01.515Z"},"url":"https://mcp.waymark.network/r/d2a2c959-efa0-4e0f-a452-f09fc229b3ad"}