2626FROM conditions
2727GROUP BY 1, 2
2828WITH NO DATA;
29- CALL refresh_continuous_aggregate('conditions_hourly', NULL, NULL, options => '{"buckets_per_batch": 0}'::jsonb);
29+ -- Setting buckets_per_batch to a high value to bypass "disabling direct compress because of too small batch size" situation
30+ CALL refresh_continuous_aggregate('conditions_hourly', NULL, NULL, options => '{"buckets_per_batch": 10000}'::jsonb);
3031SELECT DISTINCT _timescaledb_functions.chunk_status_text(chunk) FROM show_chunks('conditions_hourly') chunk;
3132 chunk_status_text
3233-------------------
@@ -38,7 +39,7 @@ ALTER MATERIALIZED VIEW conditions_hourly SET (timescaledb.compress);
3839NOTICE: defaulting compress_orderby to bucket,device_id
3940-- Enable direct compress on cagg refresh
4041SET timescaledb.enable_direct_compress_on_cagg_refresh TO on;
41- CALL refresh_continuous_aggregate('conditions_hourly', NULL, NULL, options => '{"buckets_per_batch": 0 }'::jsonb);
42+ CALL refresh_continuous_aggregate('conditions_hourly', NULL, NULL, options => '{"buckets_per_batch": 10000 }'::jsonb);
4243SELECT DISTINCT _timescaledb_functions.chunk_status_text(chunk) FROM show_chunks('conditions_hourly') chunk;
4344 chunk_status_text
4445-------------------
@@ -48,7 +49,7 @@ SELECT DISTINCT _timescaledb_functions.chunk_status_text(chunk) FROM show_chunks
4849INSERT INTO conditions
4950SELECT t, d::text, 1, 1 FROM generate_series('2025-12-15 00:00:00+00'::timestamptz - interval '1 year', '2025-12-15 00:00:00+00'::timestamptz, interval '1 hour') AS t, generate_series(1, 10) AS d;
5051SET timescaledb.enable_direct_compress_on_cagg_refresh TO off;
51- CALL refresh_continuous_aggregate('conditions_hourly', NULL, NULL, options => '{"buckets_per_batch": 0 }'::jsonb);
52+ CALL refresh_continuous_aggregate('conditions_hourly', NULL, NULL, options => '{"buckets_per_batch": 10000 }'::jsonb);
5253SELECT DISTINCT _timescaledb_functions.chunk_status_text(chunk) FROM show_chunks('conditions_hourly') chunk;
5354 chunk_status_text
5455----------------------
@@ -71,7 +72,7 @@ SELECT DISTINCT _timescaledb_functions.chunk_status_text(chunk) FROM show_chunks
7172INSERT INTO conditions
7273SELECT t, d::text, 1, 1 FROM generate_series('2025-12-15 00:00:00+00'::timestamptz - interval '1 year', '2025-12-15 00:00:00+00'::timestamptz, interval '1 hour') AS t, generate_series(1, 10) AS d;
7374SET timescaledb.enable_direct_compress_on_cagg_refresh TO on;
74- CALL refresh_continuous_aggregate('conditions_hourly', NULL, NULL, options => '{"buckets_per_batch": 0 }'::jsonb);
75+ CALL refresh_continuous_aggregate('conditions_hourly', NULL, NULL, options => '{"buckets_per_batch": 10000 }'::jsonb);
7576SELECT DISTINCT _timescaledb_functions.chunk_status_text(chunk) FROM show_chunks('conditions_hourly') chunk;
7677 chunk_status_text
7778-------------------
@@ -98,14 +99,14 @@ INSERT INTO conditions
9899SELECT t, d::text, 1, 1 FROM generate_series('2025-12-15 00:00:00+00'::timestamptz - interval '1 year', '2025-12-15 00:00:00+00'::timestamptz, interval '1 hour') AS t, generate_series(1, 10) AS d;
99100SET timescaledb.enable_direct_compress_on_cagg_refresh TO on;
100101-- Refresh the base CAgg
101- CALL refresh_continuous_aggregate('conditions_hourly', NULL, NULL, options => '{"buckets_per_batch": 0 }'::jsonb);
102+ CALL refresh_continuous_aggregate('conditions_hourly', NULL, NULL, options => '{"buckets_per_batch": 10000 }'::jsonb);
102103SELECT DISTINCT _timescaledb_functions.chunk_status_text(chunk) FROM show_chunks('conditions_hourly') chunk;
103104 chunk_status_text
104105-------------------
105106 {COMPRESSED}
106107
107108-- Refresh the hierarchical CAgg
108- CALL refresh_continuous_aggregate('conditions_daily', NULL, NULL, options => '{"buckets_per_batch": 0 }'::jsonb);
109+ CALL refresh_continuous_aggregate('conditions_daily', NULL, NULL, options => '{"buckets_per_batch": 10000 }'::jsonb);
109110SELECT DISTINCT _timescaledb_functions.chunk_status_text(chunk) FROM show_chunks('conditions_daily') chunk;
110111 chunk_status_text
111112-------------------
@@ -115,24 +116,24 @@ SELECT DISTINCT _timescaledb_functions.chunk_status_text(chunk) FROM show_chunks
115116INSERT INTO conditions
116117SELECT t, d::text, 1, 1 FROM generate_series('2025-12-15 00:00:00+00'::timestamptz - interval '1 year', '2025-12-15 00:00:00+00'::timestamptz, interval '1 hour') AS t, generate_series(1, 10) AS d;
117118-- Refresh the base CAgg
118- CALL refresh_continuous_aggregate('conditions_hourly', NULL, NULL, options => '{"buckets_per_batch": 0 }'::jsonb);
119+ CALL refresh_continuous_aggregate('conditions_hourly', NULL, NULL, options => '{"buckets_per_batch": 10000 }'::jsonb);
119120SELECT DISTINCT _timescaledb_functions.chunk_status_text(chunk) FROM show_chunks('conditions_hourly') chunk;
120121 chunk_status_text
121122-------------------
122123 {COMPRESSED}
123124
124125-- Refreshing again the base CAgg is a no-op since everything is up to date
125- CALL refresh_continuous_aggregate('conditions_hourly', NULL, NULL, options => '{"buckets_per_batch": 0 }'::jsonb);
126+ CALL refresh_continuous_aggregate('conditions_hourly', NULL, NULL, options => '{"buckets_per_batch": 10000 }'::jsonb);
126127NOTICE: continuous aggregate "conditions_hourly" is already up-to-date
127128-- Refresh the hierarchical CAgg with invalidations procuded by the base CAgg
128- CALL refresh_continuous_aggregate('conditions_daily', NULL, NULL, options => '{"buckets_per_batch": 0 }'::jsonb);
129+ CALL refresh_continuous_aggregate('conditions_daily', NULL, NULL, options => '{"buckets_per_batch": 10000 }'::jsonb);
129130SELECT DISTINCT _timescaledb_functions.chunk_status_text(chunk) FROM show_chunks('conditions_daily') chunk;
130131 chunk_status_text
131132-------------------
132133 {COMPRESSED}
133134
134135-- Refreshing again the hierarchical CAgg is a no-op since everything is up to date
135- CALL refresh_continuous_aggregate('conditions_daily', NULL, NULL, options => '{"buckets_per_batch": 0 }'::jsonb);
136+ CALL refresh_continuous_aggregate('conditions_daily', NULL, NULL, options => '{"buckets_per_batch": 10000 }'::jsonb);
136137NOTICE: continuous aggregate "conditions_daily" is already up-to-date
137138-- Tests with custom segmentby and orderby
138139CREATE MATERIALIZED VIEW conditions_weekly
@@ -148,7 +149,7 @@ FROM conditions
148149GROUP BY 1, 2, 3
149150WITH NO DATA;
150151ALTER MATERIALIZED VIEW conditions_weekly SET (timescaledb.compress_segmentby = 'device_id, location_id', timescaledb.compress_orderby = 'max, min, bucket DESC');
151- CALL refresh_continuous_aggregate('conditions_weekly', NULL, NULL, options => '{"buckets_per_batch": 0 }'::jsonb);
152+ CALL refresh_continuous_aggregate('conditions_weekly', NULL, NULL, options => '{"buckets_per_batch": 10000 }'::jsonb);
152153SELECT DISTINCT _timescaledb_functions.chunk_status_text(chunk) FROM show_chunks('conditions_weekly') chunk;
153154 chunk_status_text
154155-------------------
0 commit comments