@@ -51,12 +51,28 @@ Continuous aggregates have some limitations of what types of queries they can
5151support. For more information, see the
5252[ continuous aggregates section] [ cagg-how-tos ] .
5353
54- $TIMESCALE_DB v2.17.1 and greater dramatically decrease the amount
54+ In TimescaleDB v2.17.0 and greater (with PostgreSQL 15+), you can dramatically decrease the amount
5555of data written on a continuous aggregate in the presence of a small number of changes,
56- reduce the i/o cost of refreshing a continuous aggregate, and generate fewer Write-Ahead
57- Logs (WAL), set the` timescaledb.enable_merge_on_cagg_refresh `
58- configuration parameter to ` TRUE ` . This enables continuous aggregate
59- refresh to use merge instead of deleting old materialized data and re-inserting.
56+ reduce the I/O cost of refreshing a continuous aggregate, and generate fewer Write-Ahead
57+ Logs (WAL) by enabling the ` timescaledb.enable_merge_on_cagg_refresh `
58+ [ GUC parameter] [ gucs ] . This enables continuous aggregate
59+ refresh to use MERGE instead of deleting old materialized data and re-inserting.
60+ This is a session-level parameter that only works for finalized continuous aggregates
61+ that don't have compression enabled. It is disabled by default.
62+
63+ To enable this parameter for your session:
64+
65+ ``` sql
66+ SET timescaledb .enable_merge_on_cagg_refresh = ON ;
67+ ```
68+
69+ To enable it at the database level:
70+
71+ ``` sql
72+ ALTER DATABASE your_database SET timescaledb .enable_merge_on_cagg_refresh = ON ;
73+ ```
74+
75+ For more information about GUC parameters, see the [ configuration documentation] [ gucs ] .
6076
6177For more settings for continuous aggregates, see [ timescaledb_information.continuous_aggregates] [ info-views ] .
6278
@@ -125,3 +141,4 @@ For more information, see the [real-time aggregates][real-time-aggregates] secti
125141[ real-time-aggregates ] : /use-timescale/:currentVersion:/continuous-aggregates/real-time-aggregates/
126142[ refresh-cagg ] : /api/:currentVersion:/continuous-aggregates/refresh_continuous_aggregate/
127143[ info-views ] : /api/:currentVersion:/informational-views/continuous_aggregates/
144+ [ gucs ] : /api/:currentVersion:/configuration/gucs/
0 commit comments