Drop a continuous aggregate view
You can drop a view using theDROP MATERIALIZED VIEW command. This command also removes refresh
policies defined on the . It does not drop the data from the underlying .
To drop a view:
Drop raw data from a hypertable
If you drop data from a used in a it can lead to problems with your view. In many cases, dropping underlying data replaces the aggregate with NULL values, which can lead to unexpected results in your view. You can drop data from a usingdrop_chunks in the usual way, but before you
do so, always check that the chunk is not within the refresh window of a that still needs the data.
This is also important if you are manually refreshing a . Calling
refresh_continuous_aggregate on a region containing dropped chunks recalculates the
aggregate without the dropped data.
If a is refreshing when data is dropped because of a retention policy, the aggregate is updated to
reflect the loss of data. If you need to retain the after dropping the underlying data, set the
start_offset value of the aggregate policy to a smaller interval than the drop_after parameter of the
retention policy.
For more information, see the data retention documentation.
Set up downsampling and data retention
Maximize your storage by keeping downsampled historical data and dropping raw data. Once you’ve created a , you can automatically downsample your data by configuring the following policies:- Refresh policy: control when and how often your is updated
- Raw data retention policy: control how long to keep data in the underlying
- Downsampled data retention policy: control how long to keep data in the