From a5e1d5421db93240761a6f7a60ccd76b9db83ec7 Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com> Date: Mon, 18 Nov 2024 14:40:11 +0100 Subject: [PATCH 1/3] Add vacuum to fix flaky tests --- tsl/test/expected/compression.out | 3 ++- tsl/test/expected/compression_ddl.out | 1 + tsl/test/sql/compression.sql | 2 ++ tsl/test/sql/compression_ddl.sql | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tsl/test/expected/compression.out b/tsl/test/expected/compression.out index 05620c4ddea..fc5e0ec56db 100644 --- a/tsl/test/expected/compression.out +++ b/tsl/test/expected/compression.out @@ -1764,6 +1764,7 @@ SELECT compress_chunk(i) FROM show_chunks('f_sensor_data') i; (1 row) CALL reindex_compressed_hypertable('f_sensor_data'); +VACUUM ANALYZE f_sensor_data; -- Encourage use of parallel plans SET parallel_setup_cost = 0; SET parallel_tuple_cost = 0; @@ -1827,7 +1828,7 @@ SELECT * FROM f_sensor_data WHERE sensor_id > 100; -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Gather Output: _hyper_37_73_chunk."time", _hyper_37_73_chunk.sensor_id, _hyper_37_73_chunk.cpu, _hyper_37_73_chunk.temperature - Workers Planned: 2 + Workers Planned: 3 -> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_37_73_chunk Output: _hyper_37_73_chunk."time", _hyper_37_73_chunk.sensor_id, _hyper_37_73_chunk.cpu, _hyper_37_73_chunk.temperature -> Parallel Index Scan using compress_hyper_38_74_chunk_sensor_id__ts_meta_min_1__ts_met_idx on _timescaledb_internal.compress_hyper_38_74_chunk diff --git a/tsl/test/expected/compression_ddl.out b/tsl/test/expected/compression_ddl.out index 3a6d2c63c66..60f6d102288 100644 --- a/tsl/test/expected/compression_ddl.out +++ b/tsl/test/expected/compression_ddl.out @@ -1901,6 +1901,7 @@ SELECT compress_chunk(show_chunks('test_partials')); _timescaledb_internal._hyper_33_122_chunk (3 rows) +VACUUM ANALYZE test_partials; -- fully compressed EXPLAIN (costs off) SELECT * FROM test_partials ORDER BY time; QUERY PLAN diff --git a/tsl/test/sql/compression.sql b/tsl/test/sql/compression.sql index f12519f0e7b..adb7b81f07b 100644 --- a/tsl/test/sql/compression.sql +++ b/tsl/test/sql/compression.sql @@ -794,6 +794,8 @@ ALTER TABLE f_sensor_data SET (timescaledb.compress, timescaledb.compress_segmen SELECT compress_chunk(i) FROM show_chunks('f_sensor_data') i; CALL reindex_compressed_hypertable('f_sensor_data'); +VACUUM ANALYZE f_sensor_data; + -- Encourage use of parallel plans SET parallel_setup_cost = 0; SET parallel_tuple_cost = 0; diff --git a/tsl/test/sql/compression_ddl.sql b/tsl/test/sql/compression_ddl.sql index af872977be5..8b8c098591d 100644 --- a/tsl/test/sql/compression_ddl.sql +++ b/tsl/test/sql/compression_ddl.sql @@ -840,6 +840,7 @@ VALUES -- chunk1 -- enable compression, compress all chunks ALTER TABLE test_partials SET (timescaledb.compress); SELECT compress_chunk(show_chunks('test_partials')); +VACUUM ANALYZE test_partials; -- fully compressed EXPLAIN (costs off) SELECT * FROM test_partials ORDER BY time; -- test P, F, F From 5669f1472473488bfd00532062e12f7099336656 Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com> Date: Mon, 18 Nov 2024 15:14:48 +0100 Subject: [PATCH 2/3] Update tsl/test/expected/compression.out Signed-off-by: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com> --- tsl/test/expected/compression.out | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsl/test/expected/compression.out b/tsl/test/expected/compression.out index fc5e0ec56db..922b46e2c48 100644 --- a/tsl/test/expected/compression.out +++ b/tsl/test/expected/compression.out @@ -1764,7 +1764,7 @@ SELECT compress_chunk(i) FROM show_chunks('f_sensor_data') i; (1 row) CALL reindex_compressed_hypertable('f_sensor_data'); -VACUUM ANALYZE f_sensor_data; +VACUUM ANALYZE f_sensor_data; -- Encourage use of parallel plans SET parallel_setup_cost = 0; SET parallel_tuple_cost = 0; From 39e2b01d420b5b03bf0b522ff687a5f9eba86ad7 Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com> Date: Mon, 18 Nov 2024 15:15:03 +0100 Subject: [PATCH 3/3] Update tsl/test/expected/compression.out Signed-off-by: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com> --- tsl/test/expected/compression.out | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsl/test/expected/compression.out b/tsl/test/expected/compression.out index 922b46e2c48..fc5e0ec56db 100644 --- a/tsl/test/expected/compression.out +++ b/tsl/test/expected/compression.out @@ -1764,7 +1764,7 @@ SELECT compress_chunk(i) FROM show_chunks('f_sensor_data') i; (1 row) CALL reindex_compressed_hypertable('f_sensor_data'); -VACUUM ANALYZE f_sensor_data; +VACUUM ANALYZE f_sensor_data; -- Encourage use of parallel plans SET parallel_setup_cost = 0; SET parallel_tuple_cost = 0;