Does a select * query trigger refresh of a fresh continuous aggregate created with `WITH NO DATA` option?

I created a continuous aggregate with the WITH NO DATA option as the hypertable contains lot of data.
Then I ran a select * query on that aggregate without refreshing it.

Now the query is taking a long time to return. Is it refreshing the data in background?

By default a continuous aggregate is a realtime one, which means it’ll query raw data for all time ranges not being materialized yet. This is all the data in your case since you haven’t refreshed anything yet.

If you only want materialized data (hence nothing as of now), you need to set materialized_only to true. See parameters: Timescale Docs

1 Like