all-things-risingwave

Does materialized view filter out data by time interval?

I am concerned about the size of materialized views over time and wondering if they can filter out data based on a time interval, such as keeping only the data from the last hour or last day.

ji

jie

Asked on May 21, 2022

Yes, materialized views can filter out data by time interval to manage the size of the view. By using windowed queries in materialized views, you can specify the time interval for which data should be retained. This helps in keeping the view size manageable and prevents it from growing indefinitely. Here is an example of how you can filter data by a time interval in a materialized view:

SELECT *
FROM your_materialized_view
WHERE timestamp_column >= NOW() - INTERVAL '1 hour';
May 23, 2022Edited by