Reputation: 1234
I have a massive live table that I would like to continuously aggregate. The live table is massive, so it would take hours to fully populate the materialized view for the continuous aggregate.
Is it possible to create the materialized view WITH NO DATA and gradually fill it with a job in the background or with some refresh policy trickery?
Upvotes: 1
Views: 27
Reputation: 1234
I believe I have the correct solution. From timescale's documentation, a manual refresh on a continuous aggregate can be issued with the following command.
CALL refresh_continuous_aggregate('example', '2021-05-01', '2021-06-01');
I can set up a timescale job with a stored proc that queries for which dates have been materialized, and materialize the next range of dates on a scheduled basis until all data has been materialized. I then remove the job and set a continuous aggregate policy going forward.
Upvotes: 1