Recalculate materialized table after dropping chunks

I have a hypertable: measurements, which is materialized into: measurements_hourly. I accidentally dropped chunks from meaurement_hourly instead measurements by running:

SELECT drop_chunks('measurements_hourly', INTERVAL '1 month');

Now, I want to fix my mistake and recalculate measurements_hourly aggregation table. To do this I ran:

CALL refresh_continuous_aggregate('meaurement_hourly', NULL, NULL);

but in response I got: continuous aggregate "measurements_hourly" is already up-to-date. I guess this is beacause no chunks from measurements has been modified, so timescaledb thinks there is nothing to materialize. To fix this I simulated a change in measurements table by running:

UPDATE measurements
set value = value;

After this I could successfully rematerialize all measurements data by running:

CALL refresh_continuous_aggregate('meaurement_hourly', NULL, NULL);

I am wondering if there is any built-in way of doing what I just did? Something like “refresh all buckets, not only those that are modified”.

FYI: my timescaledb version is: 2.14.2.

That’s a great question and I’d like to suggest you to bring it as a new interface for the extension.

We have a table that controls it that is the concept behind the invalidation_logs but I don’t think we have a public interface to change it.

Here’s another related issue in some extent: