Created
April 2, 2021 13:11
-
-
Save garystafford/a8dac783c0adadccb9b53a6d453993e6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- create policies that automatically refreshes continuous aggregates | |
SELECT add_continuous_aggregate_policy('air_quality_summary_minute', | |
start_offset => INTERVAL '1 week', | |
end_offset => INTERVAL '1 hour', | |
schedule_interval => INTERVAL '1 hour'); | |
SELECT add_continuous_aggregate_policy('light_summary_minute', | |
start_offset => INTERVAL '1 week', | |
end_offset => INTERVAL '1 hour', | |
schedule_interval => INTERVAL '1 hour'); | |
SELECT add_continuous_aggregate_policy('motion_summary_minute', | |
start_offset => INTERVAL '1 week', | |
end_offset => INTERVAL '1 hour', | |
schedule_interval => INTERVAL '1 hour'); | |
SELECT add_continuous_aggregate_policy('temperature_humidity_summary_minute', | |
start_offset => INTERVAL '1 week', | |
end_offset => INTERVAL '1 hour', | |
schedule_interval => INTERVAL '1 hour'); | |
--view jobs | |
SELECT * FROM timescaledb_information.jobs; | |
--view job stats | |
SELECT job_id, total_runs, total_failures, total_successes | |
FROM timescaledb_information.job_stats; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment