---
title: Convert continuous aggregates to the columnstore | Tiger Data Docs
description: Compress a continuous aggregate to the columnstore to save storage space while making sure the data is still available for your analytical workloads
---

Since [2.20.0](https://github.com/timescale/timescaledb/releases/tag/2.20.0)

To save on storage costs, you use hypercore to downsample historical data stored in continuous aggregates. After you [enable columnstore](/docs/reference/timescaledb/continuous-aggregates/alter_materialized_view/index.md) on a `MATERIALIZED VIEW`, you set a [columnstore policy](/docs/reference/timescaledb/hypercore/add_columnstore_policy/index.md). This policy defines the intervals when chunks in a continuous aggregate are compressed as they are converted from the rowstore to the columnstore.

Columnstore works in the same way on [hypertables and continuous aggregates](/docs/learn/columnar-storage/understand-hypercore/index.md). When you enable columnstore with no other options, your data is [segmented by](/docs/reference/timescaledb/continuous-aggregates/alter_materialized_view#arguments/index.md) the `groupby` columns in the continuous aggregate, and [ordered by](/docs/reference/timescaledb/continuous-aggregates/alter_materialized_view#arguments/index.md) the time column. [Real-time aggregate](/docs/learn/continuous-aggregates/real-time-aggregates/index.md) is disabled by default.

## Configure columnstore on continuous aggregates

For an [existing continuous aggregate](/docs/build/continuous-aggregates/create-a-continuous-aggregate/index.md):

1. **Enable columnstore on a continuous aggregate**

   Set `timescaledb.enable_columnstore = true` when you alter the view:

   ```
   ALTER MATERIALIZED VIEW <cagg_name> set (timescaledb.enable_columnstore = true);
   ```

   To disable the columnstore, set `timescaledb.enable_columnstore = false`.

2. **Set columnstore policies on the continuous aggregate**

   Before you set up a columnstore policy on a continuous aggregate, you first set the [refresh policy](/docs/build/continuous-aggregates/refresh-policies/index.md). To prevent refresh policies from failing, set the columnstore policy interval so that actively refreshed regions are not compressed. For example:

   1. Set the refresh policy:

      ```
      SELECT add_continuous_aggregate_policy('<cagg_name>',
        start_offset => INTERVAL '30 days',
        end_offset => INTERVAL '1 day',
        schedule_interval => INTERVAL '1 hour');
      ```

   2. Set the columnstore policy. The `after` parameter must be greater than the value of `start_offset` in the refresh policy:

      ```
      CALL add_columnstore_policy('<cagg_name>', after => INTERVAL '45 days');
      ```
